forked from External/mage
more refactoring of ConditionalInterveningIfTriggeredAbility
This commit is contained in:
parent
24c9d5509e
commit
baa52bc617
27 changed files with 179 additions and 317 deletions
|
|
@ -1,22 +1,20 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.*;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -26,8 +24,9 @@ import mage.target.common.TargetCardInYourGraveyard;
|
|||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class BalduvianAtrocity extends CardImpl {
|
||||
|
|
@ -53,11 +52,7 @@ public final class BalduvianAtrocity extends CardImpl {
|
|||
this.addAbility(new MenaceAbility(false));
|
||||
|
||||
// When Balduvian Atrocity enters the battlefield, if it was kicked, return target creature card with mana value 3 or less from your graveyard to the battlefield. It gains haste. Sacrifice it at the beginning of the next end step.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new BalduvianAtrocityEffect()),
|
||||
KickedCondition.ONCE,
|
||||
"When {this} enters, if it was kicked, return target creature card with mana value 3 or less from your graveyard to the battlefield. It gains haste. Sacrifice it at the beginning of the next end step."
|
||||
);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new BalduvianAtrocityEffect()).withInterveningIf(KickedCondition.ONCE);
|
||||
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -76,7 +71,8 @@ class BalduvianAtrocityEffect extends OneShotEffect {
|
|||
|
||||
BalduvianAtrocityEffect() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
this.staticText = "return target creature card with mana value 3 or less from your graveyard to the battlefield. It gains haste. Sacrifice it at the beginning of the next end step.";
|
||||
this.staticText = "return target creature card with mana value 3 or less from your graveyard to the battlefield. " +
|
||||
"It gains haste. Sacrifice it at the beginning of the next end step.";
|
||||
}
|
||||
|
||||
private BalduvianAtrocityEffect(final BalduvianAtrocityEffect effect) {
|
||||
|
|
|
|||
|
|
@ -1,42 +1,37 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.CompoundCondition;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.CardsInHandCondition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.WinGameSourceControllerEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class BarrenGlory extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent();
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
private static final Condition condition = new CompoundCondition(
|
||||
"you control no permanents other than this enchantment and have no cards in hand",
|
||||
new CardsInHandCondition(ComparisonType.EQUAL_TO, 0),
|
||||
new PermanentsOnTheBattlefieldCondition(
|
||||
StaticFilters.FILTER_OTHER_CONTROLLED_PERMANENTS, ComparisonType.EQUAL_TO, 0
|
||||
)
|
||||
);
|
||||
|
||||
public BarrenGlory(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{W}{W}");
|
||||
|
||||
// At the beginning of your upkeep, if you control no permanents other than Barren Glory and have no cards in hand, you win the game.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect()),
|
||||
new CompoundCondition(
|
||||
new CardsInHandCondition(ComparisonType.EQUAL_TO, 0),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.EQUAL_TO, 0)
|
||||
),
|
||||
"At the beginning of your upkeep, if you control no permanents other than {this} and have no cards in hand, you win the game"));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect()).withInterveningIf(condition));
|
||||
}
|
||||
|
||||
private BarrenGlory(final BarrenGlory card) {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@ package mage.cards.b;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
|
|
@ -50,12 +49,8 @@ public final class BarrinTolarianArchmage extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// At the beginning of your end step, if a permanent was put into your hand from the battlefield this turn, draw a card.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfEndStepTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(1)
|
||||
), BarrinTolarianArchmageCondition.instance, "At the beginning of your end step, " +
|
||||
"if a permanent was put into your hand from the battlefield this turn, draw a card."
|
||||
), new BarrinTolarianArchmageWatcher());
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(new DrawCardSourceControllerEffect(1))
|
||||
.withInterveningIf(BarrinTolarianArchmageCondition.instance), new BarrinTolarianArchmageWatcher());
|
||||
}
|
||||
|
||||
private BarrinTolarianArchmage(final BarrinTolarianArchmage card) {
|
||||
|
|
@ -76,6 +71,11 @@ enum BarrinTolarianArchmageCondition implements Condition {
|
|||
BarrinTolarianArchmageWatcher watcher = game.getState().getWatcher(BarrinTolarianArchmageWatcher.class);
|
||||
return watcher != null && watcher.checkPlayer(source.getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "a permanent was put into your hand from the battlefield this turn";
|
||||
}
|
||||
}
|
||||
|
||||
class BarrinTolarianArchmageWatcher extends Watcher {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.cards.b;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.OpponentsLostLifeCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.hint.common.OpponentsLostLifeHint;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -27,11 +26,8 @@ public final class BatWhisperer extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Bat Whisperer enters the battlefield, if an opponent lost life this turn, create a 1/1 black Bat creature token with flying.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new BatToken())),
|
||||
OpponentsLostLifeCondition.instance, "When {this} enters, " +
|
||||
"if an opponent lost life this turn, create a 1/1 black Bat creature token with flying."
|
||||
).addHint(OpponentsLostLifeHint.instance));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new BatToken()))
|
||||
.withInterveningIf(OpponentsLostLifeCondition.instance).addHint(OpponentsLostLifeHint.instance));
|
||||
}
|
||||
|
||||
private BatWhisperer(final BatWhisperer card) {
|
||||
|
|
|
|||
|
|
@ -1,32 +1,31 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.WinGameSourceControllerEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Controllable;
|
||||
import mage.game.Game;
|
||||
import mage.players.Library;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class BattleOfWits extends CardImpl {
|
||||
|
||||
public BattleOfWits(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}{U}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
|
||||
|
||||
// At the beginning of your upkeep, if you have 200 or more cards in your library, you win the game.
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect());
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new BattleOfWitsCondition(), "At the beginning of your upkeep, if you have 200 or more cards in your library, you win the game."));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect())
|
||||
.withInterveningIf(BattleOfWitsCondition.instance));
|
||||
}
|
||||
|
||||
private BattleOfWits(final BattleOfWits card) {
|
||||
|
|
@ -39,14 +38,22 @@ public final class BattleOfWits extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class BattleOfWitsCondition implements Condition {
|
||||
enum BattleOfWitsCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null && player.getLibrary().size() >= 200) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return Optional
|
||||
.ofNullable(source)
|
||||
.map(Controllable::getControllerId)
|
||||
.map(game::getPlayer)
|
||||
.map(Player::getLibrary)
|
||||
.map(Library::size)
|
||||
.orElse(0) >= 200;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "you have 200 or more cards in your library";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardHandControllerEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class BattlewingMystic extends CardImpl {
|
||||
|
|
@ -35,12 +35,9 @@ public final class BattlewingMystic extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Battlewing Mystic enters the battlefield, if it was kicked, discard your hand, then draw two cards.
|
||||
EntersBattlefieldTriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new DiscardHandControllerEffect());
|
||||
triggeredAbility.addEffect(new DrawCardSourceControllerEffect(2));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
triggeredAbility, KickedCondition.ONCE,
|
||||
"When {this} enters, if it was kicked, discard your hand, then draw two cards."
|
||||
));
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DiscardHandControllerEffect()).withInterveningIf(KickedCondition.ONCE);
|
||||
ability.addEffect(new DrawCardSourceControllerEffect(2).concatBy(", then"));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private BattlewingMystic(final BattlewingMystic card) {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@ package mage.cards.b;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.CelebrationCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
|
|
@ -32,16 +31,10 @@ public final class BelligerentOfTheBall extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Celebration -- At the beginning of combat on your turn, if two or more nonland permanents entered the battlefield under your control this turn, target creature you control gets +1/+0 and gains menace until end of turn.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(
|
||||
new BoostTargetEffect(1, 0)
|
||||
),
|
||||
CelebrationCondition.instance, "At the beginning of combat on your turn, if two or more nonland "
|
||||
+ "permanents entered the battlefield under your control this turn, target creature you control "
|
||||
+ "gets +1/+0 and gains menace until end of turn."
|
||||
+ " <i>(It can't be blocked except by two or more creatures.)</i>"
|
||||
);
|
||||
ability.addEffect(new GainAbilityTargetEffect(new MenaceAbility(false)));
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(new BoostTargetEffect(1, 0)
|
||||
.setText("target creature you control gets +1/+0")).withInterveningIf(CelebrationCondition.instance);
|
||||
ability.addEffect(new GainAbilityTargetEffect(new MenaceAbility(false))
|
||||
.setText("and gains menace until end of turn"));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
ability.setAbilityWord(AbilityWord.CELEBRATION);
|
||||
ability.addHint(CelebrationCondition.getHint());
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -15,26 +12,26 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LoneFox
|
||||
*/
|
||||
public final class BenalishEmissary extends CardImpl {
|
||||
|
||||
public BenalishEmissary(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||
this.subtype.add(SubType.HUMAN, SubType.WIZARD);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Kicker {1}{G}
|
||||
this.addAbility(new KickerAbility("{1}{G}"));
|
||||
|
||||
// When Benalish Emissary enters the battlefield, if it was kicked, destroy target land.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect());
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()).withInterveningIf(KickedCondition.ONCE);
|
||||
ability.addTarget(new TargetLandPermanent());
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, KickedCondition.ONCE,
|
||||
"When {this} enters, if it was kicked, destroy target land."));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private BenalishEmissary(final BenalishEmissary card) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.cards.b;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeAllEffect;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -32,10 +31,7 @@ public final class BenalishSleeper extends CardImpl {
|
|||
this.addAbility(new KickerAbility("{B}"));
|
||||
|
||||
// When Benalish Sleeper enters the battlefield, if it was kicked, each player sacrifices a creature.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(
|
||||
new SacrificeAllEffect(StaticFilters.FILTER_PERMANENT_CREATURE)
|
||||
), KickedCondition.ONCE, "When {this} enters, " +
|
||||
"if it was kicked, each player sacrifices a creature."));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeAllEffect(StaticFilters.FILTER_PERMANENT_CREATURE)).withInterveningIf(KickedCondition.ONCE));
|
||||
}
|
||||
|
||||
private BenalishSleeper(final BenalishSleeper card) {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.CelebrationCondition;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.watchers.common.PermanentsEnteredBattlefieldWatcher;
|
||||
|
||||
|
|
@ -28,19 +30,12 @@ public final class BespokeBattlegarb extends CardImpl {
|
|||
this.subtype.add(SubType.EQUIPMENT);
|
||||
|
||||
// Equipped creature gets +2/+0.
|
||||
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(2, 0, Duration.WhileOnBattlefield)));
|
||||
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(2, 0)));
|
||||
|
||||
// Celebration -- At the beginning of combat on your turn, if two or more nonland permanents entered the battlefield under your control this turn, attach Bespoke Battlegarb to up to one target creature you control.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(
|
||||
new AttachEffect(
|
||||
Outcome.BoostCreature,
|
||||
"attach {this} to up to one target creature you control"
|
||||
)
|
||||
), CelebrationCondition.instance, "At the beginning of combat on your turn, if two "
|
||||
+ "or more nonland permanents entered the battlefield under your control this turn, "
|
||||
+ "attach {this} to up to one target creature you control"
|
||||
);
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(new AttachEffect(
|
||||
Outcome.BoostCreature, "attach {this} to up to one target creature you control"
|
||||
)).withInterveningIf(CelebrationCondition.instance);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent(0, 1));
|
||||
ability.setAbilityWord(AbilityWord.CELEBRATION);
|
||||
ability.addHint(CelebrationCondition.getHint());
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.ControlACommanderCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.CreateTokenCopySourceEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -36,12 +35,8 @@ public final class BiowasteBlob extends CardImpl {
|
|||
)));
|
||||
|
||||
// At the beginning of your upkeep, if you control a commander, create a token that's a copy of Biowaste Blob.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(
|
||||
new CreateTokenCopySourceEffect(), false
|
||||
), ControlACommanderCondition.instance, "At the beginning of your upkeep, " +
|
||||
"if you control a commander, create a token that's a copy of {this}."
|
||||
));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenCopySourceEffect())
|
||||
.withInterveningIf(ControlACommanderCondition.instance));
|
||||
}
|
||||
|
||||
private BiowasteBlob(final BiowasteBlob card) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.MetalcraftCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.hint.common.MetalcraftHint;
|
||||
|
|
@ -23,8 +22,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class BladeTribeBerserkers extends CardImpl {
|
||||
|
||||
private static final String effectText = "When {this} enters, if you control three or more artifacts, {this} gets +3/+3 and gains haste until end of turn.";
|
||||
|
||||
public BladeTribeBerserkers(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
|
||||
this.subtype.add(SubType.HUMAN, SubType.BERSERKER);
|
||||
|
|
@ -33,12 +30,14 @@ public final class BladeTribeBerserkers extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
//<i>Metalcraft</i> — When Blade-Tribe Berserkers enters the battlefield, if you control three or more artifacts, Blade-Tribe Berserkers gets +3/+3 and gains haste until end of turn.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new BoostSourceEffect(3, 3, Duration.EndOfTurn), false);
|
||||
ability.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MetalcraftCondition.instance, effectText)
|
||||
.setAbilityWord(AbilityWord.METALCRAFT)
|
||||
.addHint(MetalcraftHint.instance)
|
||||
);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||
new BoostSourceEffect(3, 3, Duration.EndOfTurn)
|
||||
.setText("{this} gets +3/+3"), false
|
||||
).withInterveningIf(MetalcraftCondition.instance);
|
||||
ability.addEffect(new GainAbilitySourceEffect(
|
||||
HasteAbility.getInstance(), Duration.EndOfTurn
|
||||
).setText("and gains haste until end of turn"));
|
||||
this.addAbility(ability.setAbilityWord(AbilityWord.METALCRAFT).addHint(MetalcraftHint.instance));
|
||||
}
|
||||
|
||||
private BladeTribeBerserkers(final BladeTribeBerserkers card) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.MetalcraftCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||
import mage.abilities.hint.common.MetalcraftHint;
|
||||
|
|
@ -13,7 +12,6 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -23,8 +21,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class BleakCovenVampires extends CardImpl {
|
||||
|
||||
private static final String effectText = "When {this} enters, if you control three or more artifacts, target player loses 4 life and you gain 4 life.";
|
||||
|
||||
public BleakCovenVampires(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||
this.subtype.add(SubType.VAMPIRE, SubType.WARRIOR);
|
||||
|
|
@ -33,15 +29,11 @@ public final class BleakCovenVampires extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
//<i>Metalcraft</i> — When Bleak Coven Vampires enters the battlefield, if you control three or more artifacts, target player loses 4 life and you gain 4 life.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new LoseLifeTargetEffect(4), false);
|
||||
ability.addEffect(new GainLifeEffect(4));
|
||||
Target target = new TargetPlayer();
|
||||
ability.addTarget(target);
|
||||
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MetalcraftCondition.instance, effectText)
|
||||
.setAbilityWord(AbilityWord.METALCRAFT)
|
||||
.addHint(MetalcraftHint.instance)
|
||||
);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new LoseLifeTargetEffect(4))
|
||||
.withInterveningIf(MetalcraftCondition.instance);
|
||||
ability.addEffect(new GainLifeEffect(4).concatBy("and"));
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability.setAbilityWord(AbilityWord.METALCRAFT).addHint(MetalcraftHint.instance));
|
||||
}
|
||||
|
||||
private BleakCovenVampires(final BleakCovenVampires card) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.ExileReturnBattlefieldNextEndStepTargetEffect;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
|
@ -26,7 +25,7 @@ import java.util.UUID;
|
|||
public final class BlizzardStrix extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("another target permanent");
|
||||
private static final FilterPermanent filter2 = new FilterPermanent();
|
||||
private static final FilterPermanent filter2 = new FilterPermanent("you control another snow permanent");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
|
|
@ -51,12 +50,9 @@ public final class BlizzardStrix extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Blizzard Strix enters the battlefield, if you control another snow permanent, exile target permanent other than Blizzard Strix. Return that card to the battlefield under its owner's control at the beginning of the next end step.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new ExileReturnBattlefieldNextEndStepTargetEffect()), condition,
|
||||
"When {this} enters, if you control another snow permanent, " +
|
||||
"exile target permanent other than {this}. Return that card to the battlefield " +
|
||||
"under its owner's control at the beginning of the next end step."
|
||||
);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new ExileReturnBattlefieldNextEndStepTargetEffect()
|
||||
.setText("exile target permanent other than {this}. Return that card to the " +
|
||||
"battlefield under its owner's control at the beginning of the next end step"));
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldOrAttacksSourceTriggeredAbility;
|
||||
import mage.abilities.condition.common.HellbentCondition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.keyword.MadnessAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -16,8 +13,9 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class BloodhallPriest extends CardImpl {
|
||||
|
|
@ -29,13 +27,10 @@ public final class BloodhallPriest extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Whenever Bloodhall Priest enters the battlefield or attacks, if you have no cards in hand, Bloodhall Priest deals 2 damage to any target.
|
||||
TriggeredAbility triggeredAbility = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new DamageTargetEffect(2));
|
||||
triggeredAbility.addTarget(new TargetAnyTarget());
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
triggeredAbility,
|
||||
HellbentCondition.instance,
|
||||
"Whenever {this} enters or attacks, if you have no cards in hand, {this} deals 2 damage to any target"
|
||||
));
|
||||
Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new DamageTargetEffect(2))
|
||||
.withInterveningIf(HellbentCondition.instance);
|
||||
ability.addTarget(new TargetAnyTarget());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Madness {1}{B}{R}
|
||||
this.addAbility(new MadnessAbility(new ManaCostsImpl<>("{1}{B}{R}")));
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.cards.b;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.OpponentsLostLifeCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
|
||||
import mage.abilities.hint.common.OpponentsLostLifeHint;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
|
@ -32,11 +31,8 @@ public final class BloodtitheCollector extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When this creature enters, if an opponent lost life this turn, each opponent discards a card.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new DiscardEachPlayerEffect(TargetController.OPPONENT)),
|
||||
OpponentsLostLifeCondition.instance, "When this creature enters, " +
|
||||
"if an opponent lost life this turn, each opponent discards a card."
|
||||
).addHint(OpponentsLostLifeHint.instance));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DiscardEachPlayerEffect(TargetController.OPPONENT))
|
||||
.withInterveningIf(OpponentsLostLifeCondition.instance).addHint(OpponentsLostLifeHint.instance));
|
||||
}
|
||||
|
||||
private BloodtitheCollector(final BloodtitheCollector card) {
|
||||
|
|
|
|||
|
|
@ -1,45 +1,38 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class BlowflyInfestation extends CardImpl {
|
||||
|
||||
private static final String rule = "Whenever a creature dies, if it had a -1/-1 counter on it, put a -1/-1 counter on target creature.";
|
||||
private static final FilterPermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(CounterType.M1M1.getPredicate());
|
||||
}
|
||||
|
||||
public BlowflyInfestation(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
|
||||
|
||||
//Whenever a creature dies, if it had a -1/-1 counter on it, put a -1/-1 counter on target creature.
|
||||
Effect effect = new BlowflyInfestationEffect();
|
||||
TriggeredAbility triggeredAbility = new DiesCreatureTriggeredAbility(effect, false, false, true);
|
||||
triggeredAbility.addTarget(new TargetCreaturePermanent());
|
||||
Condition condition = new BlowflyInfestationCondition();
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(triggeredAbility, condition, rule));
|
||||
|
||||
// Whenever a creature dies, if it had a -1/-1 counter on it, put a -1/-1 counter on target creature.
|
||||
Ability ability = new DiesCreatureTriggeredAbility(
|
||||
new AddCountersTargetEffect(CounterType.M1M1.createInstance()), false, filter
|
||||
).setTriggerPhrase("Whenever a creature dies, if it had a -1/-1 counter on it, ");
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private BlowflyInfestation(final BlowflyInfestation card) {
|
||||
|
|
@ -51,47 +44,3 @@ public final class BlowflyInfestation extends CardImpl {
|
|||
return new BlowflyInfestation(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BlowflyInfestationCondition implements Condition {
|
||||
|
||||
private Permanent permanent;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Effect effect : source.getEffects()) {
|
||||
if (effect.getTargetPointer().getFirst(game, source) != null) {
|
||||
permanent = effect.getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
}
|
||||
}
|
||||
if (permanent != null) {
|
||||
return permanent.getCounters(game).containsKey(CounterType.M1M1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class BlowflyInfestationEffect extends OneShotEffect {
|
||||
|
||||
BlowflyInfestationEffect() {
|
||||
super(Outcome.Detriment);
|
||||
}
|
||||
|
||||
private BlowflyInfestationEffect(final BlowflyInfestationEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanent(source.getFirstTarget());
|
||||
if (creature != null) {
|
||||
creature.addCounters(CounterType.M1M1.createInstance(), source.getControllerId(), source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlowflyInfestationEffect copy() {
|
||||
return new BlowflyInfestationEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.cards.b;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
|
|
@ -32,13 +31,9 @@ public final class BogBadger extends CardImpl {
|
|||
this.addAbility(new KickerAbility("{B}"));
|
||||
|
||||
// When Bog Badger enters the battlefield, if it was kicked, creatures you control gain menace until end of turn.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new GainAbilityControlledEffect(
|
||||
new MenaceAbility(false), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES
|
||||
)), KickedCondition.ONCE, "When {this} enters, " +
|
||||
"if it was kicked, creatures you control gain menace until end of turn. " +
|
||||
"<i>(A creature with menace can't be blocked except by two or more creatures.)</i>"
|
||||
));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainAbilityControlledEffect(
|
||||
new MenaceAbility(false), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES
|
||||
)).withInterveningIf(KickedCondition.ONCE));
|
||||
}
|
||||
|
||||
private BogBadger(final BogBadger card) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
@ -35,14 +34,10 @@ public final class BorealOutrider extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever you cast a creature spell, if {S} of any of that spell's color was spent to cast it, that creature enters the battlefield with an additional +1/+1 counter on it.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new SpellCastControllerTriggeredAbility(
|
||||
new BorealOutriderEffect(), StaticFilters.FILTER_SPELL_A_CREATURE,
|
||||
false, SetTargetPointer.SPELL
|
||||
), BorealOutriderCondition.instance, "Whenever you cast a creature spell, " +
|
||||
"if {S} of any of that spell's colors was spent to cast it, that creature " +
|
||||
"enters the battlefield with an additional +1/+1 counter on it."
|
||||
));
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(
|
||||
new BorealOutriderEffect(), StaticFilters.FILTER_SPELL_A_CREATURE,
|
||||
false, SetTargetPointer.SPELL
|
||||
).withInterveningIf(BorealOutriderCondition.instance));
|
||||
}
|
||||
|
||||
private BorealOutrider(final BorealOutrider card) {
|
||||
|
|
@ -63,6 +58,11 @@ enum BorealOutriderCondition implements Condition {
|
|||
Spell spell = (Spell) source.getEffects().get(0).getValue("spellCast");
|
||||
return spell != null && ManaPaidSourceWatcher.checkSnowColor(spell, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{S} of any of that spell's color was spent to cast it";
|
||||
}
|
||||
}
|
||||
|
||||
class BorealOutriderEffect extends ReplacementEffectImpl {
|
||||
|
|
|
|||
|
|
@ -1,30 +1,29 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.CastFromEverywhereSourceCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
||||
import mage.abilities.hint.common.DomainHint;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class BortukBonerattle extends CardImpl {
|
||||
|
|
@ -41,18 +40,12 @@ public final class BortukBonerattle extends CardImpl {
|
|||
// Domain — When Bortuk Bonerattle enters the battlefield, if you cast it, choose target creature card in your graveyard.
|
||||
// Return that card to the battlefield if its mana value is less than or equal to the number of basic land types among lands you control.
|
||||
// Otherwise, put it into your hand.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(
|
||||
new ReturnFromGraveyardToBattlefieldTargetEffect(),
|
||||
new ReturnFromGraveyardToHandTargetEffect(),
|
||||
BortukBonerattleCondition.instance,
|
||||
null
|
||||
)),
|
||||
CastFromEverywhereSourceCondition.instance,
|
||||
"When {this} enters, if you cast it, choose target creature card in your graveyard. " +
|
||||
"Return that card to the battlefield if its mana value is less than or equal to the number of basic land types among lands you control. " +
|
||||
"Otherwise, put it into your hand."
|
||||
);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(
|
||||
new ReturnFromGraveyardToBattlefieldTargetEffect(), new ReturnFromGraveyardToHandTargetEffect(),
|
||||
BortukBonerattleCondition.instance, "choose target creature card in your graveyard. " +
|
||||
"Return that card to the battlefield if its mana value is less than or equal to " +
|
||||
"the number of basic land types among lands you control. Otherwise, put it into your hand."
|
||||
)).withInterveningIf(CastFromEverywhereSourceCondition.instance);
|
||||
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
|
||||
ability.addHint(DomainHint.instance);
|
||||
ability.setAbilityWord(AbilityWord.DOMAIN);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.FerociousCondition;
|
||||
import mage.abilities.costs.common.DiscardCardCost;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.hint.common.FerociousHint;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -29,14 +28,9 @@ public final class BoundaryLandsRanger extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// At the beginning of combat on your turn, if you control a creature with power 4 or greater, you may discard a card. If you do, draw a card.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(
|
||||
new DoIfCostPaid(
|
||||
new DrawCardSourceControllerEffect(1), new DiscardCardCost()
|
||||
)
|
||||
), FerociousCondition.instance, "At the beginning of combat on your turn, if you control " +
|
||||
"a creature with power 4 or greater, you may discard a card. If you do, draw a card."
|
||||
).addHint(FerociousHint.instance));
|
||||
this.addAbility(new BeginningOfCombatTriggeredAbility(new DoIfCostPaid(
|
||||
new DrawCardSourceControllerEffect(1), new DiscardCardCost()
|
||||
)).withInterveningIf(FerociousCondition.instance).addHint(FerociousHint.instance));
|
||||
}
|
||||
|
||||
private BoundaryLandsRanger(final BoundaryLandsRanger card) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfPostcombatMainTriggeredAbility;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.condition.common.RaidCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamagePlayersEffect;
|
||||
import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect;
|
||||
import mage.abilities.hint.common.RaidHint;
|
||||
import mage.abilities.triggers.BeginningOfPostcombatMainTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
|
|
@ -42,16 +40,11 @@ public final class BrazenCannonade extends CardImpl {
|
|||
));
|
||||
|
||||
// Raid -- At the beginning of your postcombat main phase, if you attacked with a creature this turn, exile the top card of your library. Until end of combat on your next turn, you may play that card.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfPostcombatMainTriggeredAbility(
|
||||
new ExileTopXMayPlayUntilEffect(
|
||||
1, Duration.UntilEndCombatOfYourNextTurn
|
||||
), false
|
||||
), RaidCondition.instance, "At the beginning of each of your postcombat main phases, " +
|
||||
"if you attacked this turn, exile the top card of your library. " +
|
||||
"Until end of combat on your next turn, you may play that card."
|
||||
);
|
||||
this.addAbility(ability.setAbilityWord(AbilityWord.RAID).addHint(RaidHint.instance), new PlayerAttackedWatcher());
|
||||
this.addAbility(new BeginningOfPostcombatMainTriggeredAbility(
|
||||
new ExileTopXMayPlayUntilEffect(1, Duration.UntilEndCombatOfYourNextTurn), false
|
||||
).withInterveningIf(RaidCondition.instance)
|
||||
.setAbilityWord(AbilityWord.RAID)
|
||||
.addHint(RaidHint.instance), new PlayerAttackedWatcher());
|
||||
}
|
||||
|
||||
private BrazenCannonade(final BrazenCannonade card) {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.CastFromHandSourcePermanentCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
|
||||
|
|
@ -26,25 +21,25 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.targetpointer.FixedTargets;
|
||||
import mage.watchers.common.CastFromHandWatcher;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class BreachingLeviathan extends CardImpl {
|
||||
|
||||
public BreachingLeviathan(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{7}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{U}{U}");
|
||||
this.subtype.add(SubType.LEVIATHAN);
|
||||
|
||||
this.power = new MageInt(9);
|
||||
this.toughness = new MageInt(9);
|
||||
|
||||
// When Breaching Leviathan enters the battlefield, if you cast it from your hand, tap all nonblue creatures. Those creatures don't untap during their controllers' next untap steps.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new BreachingLeviathanEffect(), false),
|
||||
CastFromHandSourcePermanentCondition.instance,
|
||||
"When {this} enters, if you cast it from your hand, tap all nonblue creatures. Those creatures don't untap during their controllers' next untap steps."),
|
||||
new CastFromHandWatcher());
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new BreachingLeviathanEffect(), false)
|
||||
.withInterveningIf(CastFromHandSourcePermanentCondition.instance), new CastFromHandWatcher());
|
||||
}
|
||||
|
||||
private BreachingLeviathan(final BreachingLeviathan card) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.CastFromEverywhereSourceCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -39,12 +38,8 @@ public final class BringerOfTheLastGift extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Bringer of the Last Gift enters the battlefield, if you cast it, each player sacrifices all other creatures they control. Then each player returns all creature cards from their graveyard that weren't put there this way to the battlefield.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new BringerOfTheLastGiftEffect()),
|
||||
CastFromEverywhereSourceCondition.instance,
|
||||
"When {this} enters, if you cast it, each player sacrifices all other creatures they control. "
|
||||
+ "Then each player returns all creature cards from their graveyard that weren't put there this way to the battlefield."
|
||||
));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new BringerOfTheLastGiftEffect())
|
||||
.withInterveningIf(CastFromEverywhereSourceCondition.instance));
|
||||
}
|
||||
|
||||
private BringerOfTheLastGift(final BringerOfTheLastGift card) {
|
||||
|
|
@ -61,6 +56,9 @@ class BringerOfTheLastGiftEffect extends OneShotEffect {
|
|||
|
||||
BringerOfTheLastGiftEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "each player sacrifices all other creatures they control. " +
|
||||
"Then each player returns all creature cards from their graveyard " +
|
||||
"that weren't put there this way to the battlefield";
|
||||
}
|
||||
|
||||
private BringerOfTheLastGiftEffect(final BringerOfTheLastGiftEffect effect) {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,6 @@ public enum ControlACommanderCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "If you control a commander";
|
||||
return "you control a commander";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ public enum HellbentCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "if you have no cards in hand";
|
||||
return "you have no cards in hand";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@ public enum RaidCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "if you attacked this turn";
|
||||
return "you attacked this turn";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue