forked from External/mage
even more refactoring of ConditionalInterveningIfTriggeredAbility
All checks were successful
/ build_release (push) Successful in 10m45s
All checks were successful
/ build_release (push) Successful in 10m45s
This commit is contained in:
parent
6bbd4f457c
commit
8d93cb8bcd
56 changed files with 443 additions and 642 deletions
|
|
@ -1,10 +1,9 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.BargainedCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.FightTargetSourceEffect;
|
||||
import mage.abilities.keyword.BargainAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
|
|
@ -37,14 +36,11 @@ public final class AgathasChampion extends CardImpl {
|
|||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// When Agatha's Champion enters the battlefield, if it was bargained, it fights up to one target creature you don't control.
|
||||
TriggeredAbility trigger = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect());
|
||||
trigger.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
trigger,
|
||||
BargainedCondition.instance,
|
||||
"When {this} enters, if it was bargained, it fights up to one target creature you don't control." +
|
||||
" <i>(Each deals damage equal to its power to the other.)</i>"
|
||||
));
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||
new FightTargetSourceEffect().setText("it fights up to one target creature you don't control")
|
||||
).withInterveningIf(BargainedCondition.instance);
|
||||
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private AgathasChampion(final AgathasChampion card) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -11,12 +8,11 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
|||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.CostImpl;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CopyTargetStackObjectEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.constants.*;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -25,15 +21,18 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetOpponent;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jimga150
|
||||
*/
|
||||
public final class AlaniaDivergentStorm extends CardImpl {
|
||||
|
||||
public AlaniaDivergentStorm(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{R}");
|
||||
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.OTTER);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
|
|
@ -43,18 +42,10 @@ public final class AlaniaDivergentStorm extends CardImpl {
|
|||
// Whenever you cast a spell, if it's the first instant spell, the first sorcery spell, or the first Otter
|
||||
// spell other than Alania you've cast this turn, you may have target opponent draw a card. If you do, copy
|
||||
// that spell. You may choose new targets for the copy.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new SpellCastControllerTriggeredAbility(new DoIfCostPaid(
|
||||
new CopyTargetStackObjectEffect(true),
|
||||
new AlaniaDivergentStormCost()
|
||||
), null, false, SetTargetPointer.SPELL)
|
||||
.setTriggerPhrase("Whenever you cast a spell, if it's the first instant spell, the first sorcery " +
|
||||
"spell, or the first Otter spell other than Alania you've cast this turn, "),
|
||||
AlaniaDivergentStormCondition.instance, ""
|
||||
);
|
||||
ability.addWatcher(new AlaniaDivergentStormWatcher());
|
||||
this.addAbility(ability);
|
||||
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(
|
||||
new DoIfCostPaid(new CopyTargetStackObjectEffect(true), new AlaniaDivergentStormCost()),
|
||||
null, false, SetTargetPointer.SPELL
|
||||
).withInterveningIf(AlaniaDivergentStormCondition.instance), new AlaniaDivergentStormWatcher());
|
||||
}
|
||||
|
||||
private AlaniaDivergentStorm(final AlaniaDivergentStorm card) {
|
||||
|
|
@ -85,7 +76,7 @@ class AlaniaDivergentStormCost extends CostImpl {
|
|||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
for (UUID opponentID : game.getOpponents(controllerId)){
|
||||
for (UUID opponentID : game.getOpponents(controllerId)) {
|
||||
Player opponent = game.getPlayer(opponentID);
|
||||
if (opponent == null) {
|
||||
continue;
|
||||
|
|
@ -103,7 +94,7 @@ class AlaniaDivergentStormCost extends CostImpl {
|
|||
paid = false;
|
||||
if (this.getTargets().choose(Outcome.DrawCard, controllerId, source.getSourceId(), source, game)) {
|
||||
Player opponent = game.getPlayer(this.getTargets().getFirstTarget());
|
||||
if (opponent == null || !opponent.canRespond()){
|
||||
if (opponent == null || !opponent.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
paid = opponent.drawCards(1, source, game) > 0;
|
||||
|
|
@ -137,6 +128,11 @@ enum AlaniaDivergentStormCondition implements Condition {
|
|||
MageObjectReference spellMOR = new MageObjectReference(spell, game);
|
||||
return watcher.spellIsFirstISOCast(spellControllerID, spellMOR, sourceSpellMOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "it's the first instant spell, the first sorcery spell, or the first Otter spell other than {this} you've cast this turn";
|
||||
}
|
||||
}
|
||||
|
||||
// Based on FirstSpellCastThisTurnWatcher
|
||||
|
|
|
|||
|
|
@ -1,32 +1,33 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EndOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.AttackedOrBlockedThisCombatSourceCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.CrewAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.watchers.common.AttackedOrBlockedThisCombatWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public final class DaredevilDragster extends CardImpl {
|
||||
|
||||
private static final Condition condition = new SourceHasCounterCondition(CounterType.VELOCITY, ComparisonType.OR_GREATER, 2);
|
||||
|
||||
public DaredevilDragster(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
|
|
@ -35,11 +36,15 @@ public final class DaredevilDragster extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// At end of combat, if Daredevil Dragster attacked or blocked this combat, put a velocity counter on it. Then if it has two or more velocity counters on it, sacrifice it and draw two cards.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new EndOfCombatTriggeredAbility(new DaredevilDragsterEffect(), false),
|
||||
AttackedOrBlockedThisCombatSourceCondition.instance,
|
||||
"At end of combat, if {this} attacked or blocked this combat, put a velocity counter on it. Then if it has two or more velocity counters on it, sacrifice it and draw two cards."),
|
||||
new AttackedOrBlockedThisCombatWatcher());
|
||||
Ability ability = new EndOfCombatTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.VELOCITY.createInstance())
|
||||
.setText("put a velocity counter on it"), false
|
||||
).withInterveningIf(AttackedOrBlockedThisCombatSourceCondition.instance);
|
||||
ability.addEffect(new ConditionalOneShotEffect(
|
||||
new SacrificeSourceEffect(), condition, "Then if it has two " +
|
||||
"or more velocity counters on it, sacrifice it and draw two cards"
|
||||
).addEffect(new DrawCardSourceControllerEffect(2)));
|
||||
this.addAbility(ability, new AttackedOrBlockedThisCombatWatcher());
|
||||
|
||||
// Crew 2
|
||||
this.addAbility(new CrewAbility(2));
|
||||
|
|
@ -54,35 +59,3 @@ public final class DaredevilDragster extends CardImpl {
|
|||
return new DaredevilDragster(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DaredevilDragsterEffect extends OneShotEffect {
|
||||
|
||||
DaredevilDragsterEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "put a velocity counter on it. Then if it has two or more velocity counters on it, sacrifice it and draw two cards";
|
||||
}
|
||||
|
||||
private DaredevilDragsterEffect(final DaredevilDragsterEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DaredevilDragsterEffect copy() {
|
||||
return new DaredevilDragsterEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && permanent != null) {
|
||||
permanent.addCounters(CounterType.VELOCITY.createInstance(), source.getControllerId(), source, game);
|
||||
if (permanent.getCounters(game).getCount(CounterType.VELOCITY) >= 2) {
|
||||
permanent.sacrifice(source, game);
|
||||
controller.drawCards(2, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,19 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.condition.common.HateCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.watchers.common.LifeLossOtherFromCombatWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public final class DarkApprenticeship extends CardImpl {
|
||||
|
|
@ -23,12 +22,10 @@ public final class DarkApprenticeship extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
|
||||
|
||||
// <i>Hate</i> — At the beggining of your end step, if an opponent lost life from source other than combat damage this turn, Dark Apprenticeship deals 2 damage to target player.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfEndStepTriggeredAbility(new DamageTargetEffect(2)),
|
||||
HateCondition.instance,
|
||||
"<i>Hate</i> — At the beggining of your end step, if an opponent lost life from source other than combat damage this turn, Dark Apprenticeship deals 2 damage to target player.");
|
||||
Ability ability = new BeginningOfEndStepTriggeredAbility(new DamageTargetEffect(2))
|
||||
.withInterveningIf(HateCondition.instance);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability, new LifeLossOtherFromCombatWatcher());
|
||||
this.addAbility(ability.setAbilityWord(AbilityWord.HATE), new LifeLossOtherFromCombatWatcher());
|
||||
}
|
||||
|
||||
private DarkApprenticeship(final DarkApprenticeship card) {
|
||||
|
|
|
|||
|
|
@ -1,26 +1,21 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.condition.common.HateCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByTargetSourceEffect;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.*;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.watchers.common.LifeLossOtherFromCombatWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public final class DarthMaul extends CardImpl {
|
||||
|
|
@ -40,12 +35,10 @@ public final class DarthMaul extends CardImpl {
|
|||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// <i>Hate</i> — Whenever Darth Maul attacks, if an opponent loses life from a source other than combat damage this turn, target creature can't block this turn.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new AttacksTriggeredAbility(new CantBeBlockedByTargetSourceEffect(Duration.EndOfTurn), false),
|
||||
HateCondition.instance,
|
||||
"<i>Hate</i> — Whenever Darth Maul attacks, if an opponent loses life from a source other than combat damage this turn, target creature can't block this turn.");
|
||||
Ability ability = new AttacksTriggeredAbility(new CantBeBlockedByTargetSourceEffect(Duration.EndOfTurn))
|
||||
.withInterveningIf(HateCondition.instance);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability, new LifeLossOtherFromCombatWatcher());
|
||||
this.addAbility(ability.setAbilityWord(AbilityWord.HATE), new LifeLossOtherFromCombatWatcher());
|
||||
}
|
||||
|
||||
private DarthMaul(final DarthMaul card) {
|
||||
|
|
|
|||
|
|
@ -2,16 +2,14 @@ package mage.cards.d;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.condition.common.CardsInHandCondition;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -21,6 +19,8 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class DavrielRogueShadowmage extends CardImpl {
|
||||
|
||||
private static final Condition condition = new CardsInHandCondition(ComparisonType.OR_LESS, 1, TargetController.ACTIVE);
|
||||
|
||||
public DavrielRogueShadowmage(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B}");
|
||||
|
||||
|
|
@ -29,13 +29,12 @@ public final class DavrielRogueShadowmage extends CardImpl {
|
|||
this.setStartingLoyalty(3);
|
||||
|
||||
// At the beginning of each opponent's upkeep, if that player has one or fewer cards in hand, Davriel, Rogue Shadowmage deals 2 damage to them.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(
|
||||
Zone.BATTLEFIELD, TargetController.OPPONENT, new DamageTargetEffect(2),
|
||||
false
|
||||
), DavrielRogueShadowmageCondition.instance, "At the beginning of each opponent's upkeep, " +
|
||||
"if that player has one or fewer cards in hand, {this} deals 2 damage to them."
|
||||
));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
TargetController.OPPONENT,
|
||||
new DamageTargetEffect(
|
||||
2, true, "them", "{this}"
|
||||
), false
|
||||
).withInterveningIf(condition));
|
||||
|
||||
// -1: Target player discards a card.
|
||||
Ability ability = new LoyaltyAbility(new DiscardTargetEffect(1), -1);
|
||||
|
|
@ -52,13 +51,3 @@ public final class DavrielRogueShadowmage extends CardImpl {
|
|||
return new DavrielRogueShadowmage(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum DavrielRogueShadowmageCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(game.getActivePlayerId());
|
||||
return player != null && player.getHand().size() < 2;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.CovenCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.hint.common.CovenHint;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
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.Duration;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -30,13 +32,8 @@ public final class DawnhartWardens extends CardImpl {
|
|||
this.addAbility(VigilanceAbility.getInstance());
|
||||
|
||||
// Coven — At the beginning of combat on your turn, if you control three or more creatures with different powers, creatures you control get +1/+0 until end of turn.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(
|
||||
new BoostControlledEffect(1, 0, Duration.EndOfTurn)
|
||||
), CovenCondition.instance, "At the beginning of combat on your turn, " +
|
||||
"if you control three or more creatures with different powers, " +
|
||||
"creatures you control get +1/+0 until end of turn."
|
||||
).addHint(CovenHint.instance).setAbilityWord(AbilityWord.COVEN));
|
||||
this.addAbility(new BeginningOfCombatTriggeredAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn))
|
||||
.withInterveningIf(CovenCondition.instance).addHint(CovenHint.instance).setAbilityWord(AbilityWord.COVEN));
|
||||
}
|
||||
|
||||
private DawnhartWardens(final DawnhartWardens card) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.cards.d;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.condition.common.CitysBlessingCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.hint.common.CitysBlessingHint;
|
||||
import mage.abilities.keyword.AscendAbility;
|
||||
|
|
@ -35,11 +34,8 @@ public final class DeadeyeBrawler extends CardImpl {
|
|||
this.addAbility(new AscendAbility());
|
||||
|
||||
// Whenever Deadeye Brawler deals combat damage to a player, if you have the city's blessing, draw a card.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new DealsCombatDamageToAPlayerTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(1), false, false), CitysBlessingCondition.instance,
|
||||
"Whenever {this} deals combat damage to a player, if you have the city's blessing, draw a card.")
|
||||
.addHint(CitysBlessingHint.instance));
|
||||
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1))
|
||||
.withInterveningIf(CitysBlessingCondition.instance).addHint(CitysBlessingHint.instance));
|
||||
}
|
||||
|
||||
private DeadeyeBrawler(final DeadeyeBrawler card) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.RaidCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.abilities.hint.common.RaidHint;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -31,8 +30,7 @@ public final class DeadeyeRigHauler extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// <i>Raid</i>— When Deadeye Rig-Hauler enters the battlefield, if you attacked this turn, you may return target creature to its owner's hand.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true), RaidCondition.instance,
|
||||
"When {this} enters, if you attacked this turn, you may return target creature to its owner's hand.");
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true).withInterveningIf(RaidCondition.instance);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
ability.setAbilityWord(AbilityWord.RAID);
|
||||
ability.addHint(RaidHint.instance);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.cards.d;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.condition.common.LastTimeCounterRemovedCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.VanishingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -29,8 +28,7 @@ public final class DeadlyGrub extends CardImpl {
|
|||
this.addAbility(new VanishingAbility(3));
|
||||
|
||||
// When Deadly Grub dies, if it had no time counters on it, create a 6/1 green Insect creature token with shroud.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new DiesSourceTriggeredAbility(new CreateTokenEffect(new DeadlyGrubInsectToken(), 1)),
|
||||
LastTimeCounterRemovedCondition.instance, "When {this} dies, if it had no time counters on it, create a 6/1 green Insect creature token with shroud."));
|
||||
this.addAbility(new DiesSourceTriggeredAbility(new CreateTokenEffect(new DeadlyGrubInsectToken(), 1)).withInterveningIf(LastTimeCounterRemovedCondition.instance));
|
||||
}
|
||||
|
||||
private DeadlyGrub(final DeadlyGrub card) {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
@ -20,8 +17,9 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.target.common.TargetAnyTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public final class DeathSpark extends CardImpl {
|
||||
|
|
@ -29,19 +27,15 @@ public final class DeathSpark extends CardImpl {
|
|||
public DeathSpark(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
|
||||
|
||||
|
||||
// Death Spark deals 1 damage to any target.
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(1));
|
||||
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
||||
|
||||
// At the beginning of your upkeep, if Death Spark is in your graveyard with a creature card directly above it, you may pay {1}. If you do, return Death Spark to your hand.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(
|
||||
Zone.GRAVEYARD,
|
||||
TargetController.YOU, new DoIfCostPaid(new ReturnSourceFromGraveyardToHandEffect(), new GenericManaCost(1)),
|
||||
false),
|
||||
DeathSparkCondition.instance,
|
||||
"At the beginning of your upkeep, if {this} is in your graveyard with a creature card directly above it, you may pay {1}. If you do, return {this} to your hand."));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
Zone.GRAVEYARD, TargetController.YOU,
|
||||
new DoIfCostPaid(new ReturnSourceFromGraveyardToHandEffect(), new GenericManaCost(1)), false
|
||||
).withInterveningIf(DeathSparkCondition.instance));
|
||||
}
|
||||
|
||||
private DeathSpark(final DeathSpark card) {
|
||||
|
|
@ -55,21 +49,21 @@ public final class DeathSpark extends CardImpl {
|
|||
}
|
||||
|
||||
enum DeathSparkCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
boolean nextCard = false;
|
||||
for (Card card : controller.getGraveyard().getCards(game)) {
|
||||
if (nextCard) {
|
||||
return card.isCreature(game);
|
||||
}
|
||||
if (card.getId().equals(source.getSourceId())) {
|
||||
nextCard = true;
|
||||
}
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
boolean nextCard = false;
|
||||
for (Card card : controller.getGraveyard().getCards(game)) {
|
||||
if (nextCard) {
|
||||
return card.isCreature(game);
|
||||
}
|
||||
if (card.getId().equals(source.getSourceId())) {
|
||||
nextCard = true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,27 +1,25 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.CompoundCondition;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.CastFromHandSourcePermanentCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.CastFromHandWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class DeathbringerRegent extends CardImpl {
|
||||
|
|
@ -32,6 +30,12 @@ public final class DeathbringerRegent extends CardImpl {
|
|||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
private static final Condition condition = new CompoundCondition(
|
||||
"you cast it from your hand and there are five or more other creatures on the battlefield",
|
||||
CastFromHandSourcePermanentCondition.instance,
|
||||
new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 4)
|
||||
);
|
||||
|
||||
public DeathbringerRegent(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{B}{B}");
|
||||
this.subtype.add(SubType.DRAGON);
|
||||
|
|
@ -42,11 +46,8 @@ public final class DeathbringerRegent extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Deathbringer Regent enters the battlefield, if you cast it from your hand and there are five or more other creatures on the battlefield, destroy all other creatures.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new DestroyAllEffect(filter), false),
|
||||
new DeathbringerRegentCondition(),
|
||||
"When {this} enters, if you cast it from your hand and there are five or more other creatures on the battlefield, destroy all other creatures."),
|
||||
new CastFromHandWatcher());
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DestroyAllEffect(filter))
|
||||
.withInterveningIf(condition), new CastFromHandWatcher());
|
||||
}
|
||||
|
||||
private DeathbringerRegent(final DeathbringerRegent card) {
|
||||
|
|
@ -58,12 +59,3 @@ public final class DeathbringerRegent extends CardImpl {
|
|||
return new DeathbringerRegent(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DeathbringerRegentCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return CastFromHandSourcePermanentCondition.instance.apply(game, source)
|
||||
&& game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source, game).size() >= 6;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,23 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesSourceTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.ZombieBerserkerToken;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class DeathknellBerserker extends CardImpl {
|
||||
|
|
@ -30,11 +31,8 @@ public final class DeathknellBerserker extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Deathknell Berserker dies, if its power was 3 or greater, create a 2/2 black Zombie Berserker creature token.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new DiesSourceTriggeredAbility(new CreateTokenEffect(new ZombieBerserkerToken())),
|
||||
DeathknellBerserkerCondtion.instance,
|
||||
"When {this} dies, if its power was 3 or greater, create a 2/2 black Zombie Berserker creature token."
|
||||
));
|
||||
this.addAbility(new DiesSourceTriggeredAbility(new CreateTokenEffect(new ZombieBerserkerToken()))
|
||||
.withInterveningIf(DeathknellBerserkerCondtion.instance));
|
||||
}
|
||||
|
||||
private DeathknellBerserker(final DeathknellBerserker card) {
|
||||
|
|
@ -53,7 +51,16 @@ enum DeathknellBerserkerCondtion implements Condition {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = (Permanent) source.getEffects().get(0).getValue("permanentLeftBattlefield");
|
||||
return permanent != null && permanent.getPower().getValue() >= 3;
|
||||
return CardUtil
|
||||
.getEffectValueFromAbility(source, "permanentLeftBattlefield", Permanent.class)
|
||||
.map(MageObject::getPower)
|
||||
.map(MageInt::getValue)
|
||||
.filter(x -> x >= 3)
|
||||
.isPresent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "its power was 3 or greater";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,40 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import java.util.Set;
|
||||
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.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.filter.common.FilterOpponentsCreaturePermanent;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public final class DefenseOfTheHeart extends CardImpl {
|
||||
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||
new FilterOpponentsCreaturePermanent("an opponent controls three or more creatures"),
|
||||
ComparisonType.MORE_THAN, 2
|
||||
);
|
||||
|
||||
public DefenseOfTheHeart(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}");
|
||||
|
||||
// At the beginning of your upkeep, if an opponent controls three or more creatures, sacrifice Defense of the Heart, search your library for up to two creature cards, and put those cards onto the battlefield. Then shuffle your library.
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceEffect());
|
||||
ability.addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, StaticFilters.FILTER_CARD_CREATURE), false));
|
||||
DefenseOfTheHeartCondition contition = new DefenseOfTheHeartCondition();
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, contition, "At the beginning of your upkeep, if an opponent controls three or more creatures, sacrifice {this}, search your library for up to two creature cards, put those cards onto the battlefield, then shuffle"));
|
||||
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceEffect()).withInterveningIf(condition);
|
||||
ability.addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(
|
||||
2, StaticFilters.FILTER_CARD_CREATURES
|
||||
)).concatBy(","));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private DefenseOfTheHeart(final DefenseOfTheHeart card) {
|
||||
|
|
@ -41,18 +45,4 @@ public final class DefenseOfTheHeart extends CardImpl {
|
|||
public DefenseOfTheHeart copy() {
|
||||
return new DefenseOfTheHeart(this);
|
||||
}
|
||||
|
||||
static class DefenseOfTheHeartCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Set<UUID> opponents = game.getOpponents(source.getControllerId());
|
||||
for (UUID uuid : opponents) {
|
||||
if (game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, uuid, game) >= 3) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.cards.d;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.condition.common.DeliriumCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
|
|
@ -37,13 +36,9 @@ public final class DemolisherSpawn extends CardImpl {
|
|||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// Delirium -- Whenever Demolisher Spawn attacks, if there are four or more card types among cards in your graveyard, other attacking creatures get +4/+4 until end of turn.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new AttacksTriggeredAbility(new BoostAllEffect(
|
||||
4, 4, Duration.EndOfTurn,
|
||||
StaticFilters.FILTER_ATTACKING_CREATURES, true
|
||||
)), DeliriumCondition.instance, "Whenever {this} attacks, if there are four or more " +
|
||||
"card types among cards in your graveyard, other attacking creatures get +4/+4 until end of turn."
|
||||
).setAbilityWord(AbilityWord.DELIRIUM).addHint(CardTypesInGraveyardCount.YOU.getHint()));
|
||||
this.addAbility(new AttacksTriggeredAbility(new BoostAllEffect(
|
||||
4, 4, Duration.EndOfTurn, StaticFilters.FILTER_ATTACKING_CREATURES, true
|
||||
)).withInterveningIf(DeliriumCondition.instance).setAbilityWord(AbilityWord.DELIRIUM).addHint(CardTypesInGraveyardCount.YOU.getHint()));
|
||||
}
|
||||
|
||||
private DemolisherSpawn(final DemolisherSpawn card) {
|
||||
|
|
|
|||
|
|
@ -1,31 +1,33 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.condition.common.CreatureCountCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.permanent.token.DemonToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author noxx
|
||||
*/
|
||||
public final class DemonicRising extends CardImpl {
|
||||
|
||||
private static final String ruleText = "At the beginning of your end step, if you control exactly one creature, create a 5/5 black Demon creature token with flying";
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||
new FilterControlledCreaturePermanent("you control exactly one creature"),
|
||||
ComparisonType.EQUAL_TO, 1
|
||||
);
|
||||
|
||||
public DemonicRising(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}");
|
||||
|
||||
// At the beginning of your end step, if you control exactly one creature, create a 5/5 black Demon creature token with flying.
|
||||
TriggeredAbility ability = new BeginningOfEndStepTriggeredAbility(new CreateTokenEffect(new DemonToken()));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new CreatureCountCondition(1, TargetController.YOU), ruleText));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(new CreateTokenEffect(new DemonToken())).withInterveningIf(condition));
|
||||
}
|
||||
|
||||
private DemonicRising(final DemonicRising card) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
|
||||
import mage.abilities.condition.common.SourceHasCountersCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.counter.AddCounterChoiceSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -43,14 +42,9 @@ public class DenryKlinEditorInChief extends CardImpl {
|
|||
|
||||
// Whenever a nontoken creature you control enters,
|
||||
// if Denry has counters on it, put the same number of each kind of counter on that creature.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldControlledTriggeredAbility(
|
||||
new DenryKlinEditorInChiefCopyCountersEffect(),
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN),
|
||||
SourceHasCountersCondition.instance,
|
||||
"Whenever a nontoken creature you control enters, " +
|
||||
"if Denry has counters on it, put the same number of each kind of counter on that creature.")
|
||||
);
|
||||
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
|
||||
new DenryKlinEditorInChiefCopyCountersEffect(), StaticFilters.FILTER_CONTROLLED_CREATURE_NON_TOKEN
|
||||
).withInterveningIf(SourceHasCountersCondition.instance));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -68,6 +62,7 @@ class DenryKlinEditorInChiefCopyCountersEffect extends OneShotEffect {
|
|||
|
||||
DenryKlinEditorInChiefCopyCountersEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "put the same number of each kind of counter on that creature";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.cards.d;
|
|||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.DesertControlledOrGraveyardCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.combat.CantBlockAttackActivateAttachedEffect;
|
||||
|
|
@ -35,11 +34,9 @@ public final class DesertsHold extends CardImpl {
|
|||
this.addAbility(new EnchantAbility(auraTarget));
|
||||
|
||||
// When Desert's Hold enters the battlefield, if you control a Desert or there is a Desert card in your graveyard, you gain 3 life.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3)),
|
||||
DesertControlledOrGraveyardCondition.instance, "When {this} enters, " +
|
||||
"if you control a Desert or there is a Desert card in your graveyard, you gain 3 life."
|
||||
).addHint(DesertControlledOrGraveyardCondition.getHint()));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(3))
|
||||
.withInterveningIf(DesertControlledOrGraveyardCondition.instance)
|
||||
.addHint(DesertControlledOrGraveyardCondition.getHint()));
|
||||
|
||||
// Enchanted creature can't attack or block, and its activated abilities can't be activated.
|
||||
this.addAbility(new SimpleStaticAbility(new CantBlockAttackActivateAttachedEffect()));
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.BargainedCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateRoleAttachedTargetEffect;
|
||||
import mage.abilities.hint.common.BargainCostWasPaidHint;
|
||||
import mage.abilities.keyword.BargainAbility;
|
||||
|
|
@ -34,11 +33,8 @@ public final class DiminisherWitch extends CardImpl {
|
|||
this.addAbility(new BargainAbility());
|
||||
|
||||
// When Diminisher Witch enters the battlefield, if it was bargained, create a Cursed Role token attached to target creature an opponent controls.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new CreateRoleAttachedTargetEffect(RoleType.CURSED)),
|
||||
BargainedCondition.instance, "When {this} enters, if it was bargained, " +
|
||||
"create a Cursed Role token attached to target creature an opponent controls."
|
||||
);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new CreateRoleAttachedTargetEffect(RoleType.CURSED))
|
||||
.withInterveningIf(BargainedCondition.instance);
|
||||
ability.addTarget(new TargetOpponentsCreaturePermanent());
|
||||
this.addAbility(ability.addHint(BargainCostWasPaidHint.instance));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,18 +2,17 @@ package mage.cards.d;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.OpponentControlsMoreCondition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||
import mage.abilities.hint.ConditionHint;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
|
|
@ -34,11 +33,11 @@ import java.util.UUID;
|
|||
* @author Susucr
|
||||
*/
|
||||
public final class DiscerningFinancier extends CardImpl {
|
||||
private static final Condition condition = new OpponentControlsMoreCondition(StaticFilters.FILTER_LAND);
|
||||
private static final Condition condition = new OpponentControlsMoreCondition(StaticFilters.FILTER_LANDS);
|
||||
|
||||
private static final Hint hint = new ConditionHint(
|
||||
condition, "An opponent controls more land than you", null,
|
||||
"No opponent controls more land than you", null, true
|
||||
condition, "An opponent controls more lands than you", null,
|
||||
"No opponent controls more lands than you", null, true
|
||||
);
|
||||
|
||||
private static final FilterControlledPermanent filter =
|
||||
|
|
@ -53,14 +52,9 @@ public final class DiscerningFinancier extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// At the beginning of your upkeep, if an opponent controls more lands than you, create a Treasure token.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(
|
||||
new CreateTokenEffect(new TreasureToken()), false
|
||||
),
|
||||
condition,
|
||||
"At the beginning of your upkeep, if an opponent controls more lands than you, create a Treasure token."
|
||||
).addHint(hint));
|
||||
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new CreateTokenEffect(new TreasureToken()), false
|
||||
).withInterveningIf(condition).addHint(hint));
|
||||
|
||||
// {2}{W}: Choose another player. That player gains control of target Treasure you control. You draw a card.
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
|
|
|
|||
|
|
@ -1,52 +1,48 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.ControlEnchantedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class Domestication extends CardImpl {
|
||||
|
||||
public Domestication(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}");
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.GainControl));
|
||||
Ability ability = new EnchantAbility(auraTarget);
|
||||
this.addAbility(ability);
|
||||
|
||||
this.addAbility(new EnchantAbility(auraTarget));
|
||||
|
||||
// You control enchanted creature.
|
||||
this.addAbility(new SimpleStaticAbility(new ControlEnchantedEffect()));
|
||||
|
||||
|
||||
// At the beginning of your end step, if enchanted creature's power is 4 or greater, sacrifice Domestication.
|
||||
TriggeredAbility ability2 = new BeginningOfEndStepTriggeredAbility(new SacrificeSourceEffect());
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability2, new DomesticationCondition(), "At the beginning of your end step, if enchanted creature's power is 4 or greater, sacrifice {this}"));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(new SacrificeSourceEffect()).withInterveningIf(DomesticationCondition.instance));
|
||||
}
|
||||
|
||||
private Domestication(final Domestication card) {
|
||||
|
|
@ -59,19 +55,23 @@ public final class Domestication extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class DomesticationCondition implements Condition {
|
||||
|
||||
enum DomesticationCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
if (enchantment != null) {
|
||||
Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
|
||||
if (enchanted != null) {
|
||||
if (enchanted.getPower().getValue() >= 4) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return Optional
|
||||
.ofNullable(source.getSourcePermanentIfItStillExists(game))
|
||||
.map(Permanent::getAttachedTo)
|
||||
.map(game::getPermanent)
|
||||
.map(MageObject::getPower)
|
||||
.map(MageInt::getValue)
|
||||
.filter(x -> x >= 4)
|
||||
.isPresent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "enchanted creature's power is 4 or greater";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
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.LoseLifeOpponentsEffect;
|
||||
import mage.abilities.keyword.DevoidAbility;
|
||||
import mage.abilities.keyword.IngestAbility;
|
||||
|
|
@ -13,25 +12,27 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.ColorlessPredicate;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.filter.predicate.mageobject.ColorlessPredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class DominatorDrone extends CardImpl {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another colorless creature");
|
||||
private static final FilterPermanent filter = new FilterControlledCreaturePermanent("you control another colorless creature");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
filter.add(ColorlessPredicate.instance);
|
||||
}
|
||||
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter);
|
||||
|
||||
public DominatorDrone(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||
this.subtype.add(SubType.ELDRAZI);
|
||||
|
|
@ -46,12 +47,7 @@ public final class DominatorDrone extends CardImpl {
|
|||
this.addAbility(new IngestAbility());
|
||||
|
||||
// When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life.
|
||||
TriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new LoseLifeOpponentsEffect(2));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
triggeredAbility,
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"When {this} enters, if you control another colorless creature, each opponent loses 2 life."));
|
||||
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new LoseLifeOpponentsEffect(2)).withInterveningIf(condition));
|
||||
}
|
||||
|
||||
private DominatorDrone(final DominatorDrone card) {
|
||||
|
|
|
|||
|
|
@ -2,18 +2,20 @@ package mage.cards.d;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.CastFromEverywhereSourceCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -35,16 +37,10 @@ public final class DoomsdayExcruciator extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Doomsday Excruciator enters, if it was cast, each player exiles all but the bottom six cards of their library face down.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new DoomsdayExcruciatorEffect()),
|
||||
CastFromEverywhereSourceCondition.instance, "When {this} enters, if it was cast, " +
|
||||
"each player exiles all but the bottom six cards of their library face down."
|
||||
));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DoomsdayExcruciatorEffect()).withInterveningIf(CastFromEverywhereSourceCondition.instance));
|
||||
|
||||
// At the beginning of your upkeep, draw a card.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(1)
|
||||
));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1)));
|
||||
}
|
||||
|
||||
private DoomsdayExcruciator(final DoomsdayExcruciator card) {
|
||||
|
|
@ -61,6 +57,7 @@ class DoomsdayExcruciatorEffect extends OneShotEffect {
|
|||
|
||||
DoomsdayExcruciatorEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "each player exiles all but the bottom six cards of their library face down";
|
||||
}
|
||||
|
||||
private DoomsdayExcruciatorEffect(final DoomsdayExcruciatorEffect effect) {
|
||||
|
|
|
|||
|
|
@ -1,38 +1,30 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.abilities.hint.common.LandsYouControlHint;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.game.permanent.token.DragonToken2;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class DragonmasterOutcast extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("land");
|
||||
|
||||
static {
|
||||
filter.add(CardType.LAND.getPredicate());
|
||||
}
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent("you control six or more lands"), ComparisonType.MORE_THAN, 5);
|
||||
|
||||
public DragonmasterOutcast(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SHAMAN);
|
||||
|
||||
|
|
@ -40,11 +32,8 @@ public final class DragonmasterOutcast extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// At the beginning of your upkeep, if you control six or more lands, create a 5/5 red Dragon creature token with flying.
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new DragonToken2(), 1));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
ability, new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 5),
|
||||
"At the beginning of your upkeep, if you control six or more lands, create a 5/5 red Dragon creature token with flying."
|
||||
).addHint(new ValueHint("Lands you control", new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND))));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new DragonToken2(), 1))
|
||||
.withInterveningIf(condition).addHint(LandsYouControlHint.instance));
|
||||
}
|
||||
|
||||
private DragonmasterOutcast(final DragonmasterOutcast card) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
package mage.cards.d;
|
||||
|
||||
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.CastFromHandSourcePermanentCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.effects.common.TapAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -15,23 +13,26 @@ import mage.constants.SubType;
|
|||
import mage.filter.StaticFilters;
|
||||
import mage.watchers.common.CastFromHandWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public final class DreadCacodemon extends CardImpl {
|
||||
|
||||
public DreadCacodemon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{7}{B}{B}{B}");
|
||||
public DreadCacodemon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{B}{B}{B}");
|
||||
this.subtype.add(SubType.DEMON);
|
||||
this.power = new MageInt(8);
|
||||
this.toughness = new MageInt(8);
|
||||
|
||||
// When Dread Cacodemon enters the battlefield,
|
||||
// if you cast it from your hand, destroy all creatures your opponents control, then tap all other creatures you control.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES));
|
||||
ability.addEffect(new TapAllEffect(StaticFilters.FILTER_OTHER_CONTROLLED_CREATURES));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, CastFromHandSourcePermanentCondition.instance,
|
||||
"When {this} enters, if you cast it from your hand, destroy all creatures your opponents control, then tap all other creatures you control."), new CastFromHandWatcher());
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||
new DestroyAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES)
|
||||
).withInterveningIf(CastFromHandSourcePermanentCondition.instance);
|
||||
ability.addEffect(new TapAllEffect(StaticFilters.FILTER_OTHER_CONTROLLED_CREATURES).concatBy(", then"));
|
||||
this.addAbility(ability, new CastFromHandWatcher());
|
||||
}
|
||||
|
||||
private DreadCacodemon(final DreadCacodemon card) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CanBlockOnlyFlyingAbility;
|
||||
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.TapTargetEffect;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
|
@ -15,25 +14,26 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.target.common.TargetNonlandPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class DreamcallerSiren extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another Pirate");
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent(SubType.PIRATE, "you control another Pirate");
|
||||
|
||||
static {
|
||||
filter.add(SubType.PIRATE.getPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
filter.add(TargetController.YOU.getControllerPredicate());
|
||||
}
|
||||
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter);
|
||||
|
||||
public DreamcallerSiren(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
|
||||
|
||||
|
|
@ -52,11 +52,9 @@ public final class DreamcallerSiren extends CardImpl {
|
|||
this.addAbility(new CanBlockOnlyFlyingAbility());
|
||||
|
||||
// When Dreamcaller Siren enters the battlefield, if you control another Pirate, tap up to two nonland permanents.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect());
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect()).withInterveningIf(condition);
|
||||
ability.addTarget(new TargetNonlandPermanent(0, 2, false));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability,
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"when {this} enters, if you control another Pirate, tap up to two target nonland permanents."));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private DreamcallerSiren(final DreamcallerSiren card) {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.EnchantedSourceCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -14,12 +12,15 @@ import mage.constants.SubType;
|
|||
import mage.constants.TargetController;
|
||||
import mage.game.permanent.token.SaprolingToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class DreampodDruid extends CardImpl {
|
||||
|
||||
private static final Condition condition = new EnchantedSourceCondition();
|
||||
|
||||
public DreampodDruid(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
|
|
@ -29,10 +30,9 @@ public final class DreampodDruid extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// At the beginning of each upkeep, if Dreampod Druid is enchanted, create a 1/1 green Saproling creature token.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(TargetController.ANY, new CreateTokenEffect(new SaprolingToken(), 1), false),
|
||||
new EnchantedSourceCondition(),
|
||||
"At the beginning of each upkeep, if Dreampod Druid is enchanted, create a 1/1 green Saproling creature token."));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
TargetController.ANY, new CreateTokenEffect(new SaprolingToken(), 1), false
|
||||
).withInterveningIf(condition));
|
||||
}
|
||||
|
||||
private DreampodDruid(final DreampodDruid card) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
|
|
@ -45,11 +44,7 @@ public final class DrizztDoUrden extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GuenhwyvarToken())));
|
||||
|
||||
// Whenever a creature dies, if it had power greater than Drizzt's power, put a number of +1/+1 counters on Drizzt equal to the difference.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new DiesCreatureTriggeredAbility(new DrizztDoUrdenEffect(), false),
|
||||
DrizztDoUrdenCondition.instance, "Whenever a creature dies, if it had power greater " +
|
||||
"than {this}'s power, put a number of +1/+1 counters on {this} equal to the difference."
|
||||
));
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(new DrizztDoUrdenEffect(), false).withInterveningIf(DrizztDoUrdenCondition.instance));
|
||||
}
|
||||
|
||||
private DrizztDoUrden(final DrizztDoUrden card) {
|
||||
|
|
@ -76,12 +71,18 @@ enum DrizztDoUrdenCondition implements Condition {
|
|||
.filter(x -> sourcePermanent.getPower().getValue() < x)
|
||||
.isPresent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "it had power greater than {this}'s power";
|
||||
}
|
||||
}
|
||||
|
||||
class DrizztDoUrdenEffect extends OneShotEffect {
|
||||
|
||||
DrizztDoUrdenEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "put a number of +1/+1 counters on {this} equal to the difference";
|
||||
}
|
||||
|
||||
private DrizztDoUrdenEffect(final DrizztDoUrdenEffect effect) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.condition.common.ManaWasSpentCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CastSourceTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.DevoidAbility;
|
||||
|
|
@ -38,12 +36,8 @@ public final class DrownerOfTruth extends ModalDoubleFacedCard {
|
|||
this.getLeftHalfCard().addAbility(new DevoidAbility(this.getLeftHalfCard().getColor()));
|
||||
|
||||
// When you cast this spell, if {C} was spent to cast it, create two 0/1 colorless Eldrazi Spawn creature tokens with "Sacrifice this creature: Add {C}."
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new CastSourceTriggeredAbility(new CreateTokenEffect(new EldraziSpawnToken(), 2)),
|
||||
ManaWasSpentCondition.COLORLESS,
|
||||
"When you cast this spell, if {C} was spent to cast it, "
|
||||
+ "create two 0/1 colorless Eldrazi Spawn creature tokens with \"Sacrifice this creature: Add {C}.\"");
|
||||
this.getLeftHalfCard().addAbility(ability);
|
||||
this.getLeftHalfCard().addAbility(new CastSourceTriggeredAbility(new CreateTokenEffect(new EldraziSpawnToken(), 2))
|
||||
.withInterveningIf(ManaWasSpentCondition.COLORLESS));
|
||||
|
||||
// 2.
|
||||
// Drowned Jungle
|
||||
|
|
|
|||
|
|
@ -2,16 +2,18 @@ package mage.cards.d;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.CovenCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.hint.common.CovenHint;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
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.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -33,13 +35,9 @@ public final class DuelcraftTrainer extends CardImpl {
|
|||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
|
||||
// Coven — At the beginning of combat on your turn, if you control three or more creatures with different powers, target creature you control gains double strike until end of turn.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(new GainAbilityTargetEffect(
|
||||
DoubleStrikeAbility.getInstance(), Duration.EndOfTurn
|
||||
)), CovenCondition.instance, "At the beginning " +
|
||||
"of combat on your turn, if you control three or more creatures with different powers, " +
|
||||
"target creature you control gains double strike until end of turn."
|
||||
);
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(
|
||||
new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn)
|
||||
).withInterveningIf(CovenCondition.instance);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability.addHint(CovenHint.instance).setAbilityWord(AbilityWord.COVEN));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,38 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
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.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.target.common.TargetArtifactPermanent;
|
||||
import mage.target.common.TargetEnchantmentPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class DuergarHedgeMage extends CardImpl {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("a Mountain");
|
||||
private static final FilterLandPermanent filter2 = new FilterLandPermanent("a Plains");
|
||||
|
||||
static {
|
||||
filter.add(SubType.MOUNTAIN.getPredicate());
|
||||
filter2.add(SubType.PLAINS.getPredicate());
|
||||
}
|
||||
private static final String rule1 = "When {this} enters, if you control two or more Mountains, you may destroy target artifact.";
|
||||
private static final String rule2 = "When {this} enters, if you control two or more Plains, you may destroy target enchantment.";
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||
new FilterControlledPermanent(SubType.MOUNTAIN, "you control two or more Mountains"),
|
||||
ComparisonType.MORE_THAN, 1
|
||||
);
|
||||
private static final Condition condition2 = new PermanentsOnTheBattlefieldCondition(
|
||||
new FilterControlledPermanent(SubType.PLAINS, "you control two or more Plains"),
|
||||
ComparisonType.MORE_THAN, 1
|
||||
);
|
||||
|
||||
public DuergarHedgeMage(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R/W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R/W}");
|
||||
this.subtype.add(SubType.DWARF);
|
||||
this.subtype.add(SubType.SHAMAN);
|
||||
|
||||
|
|
@ -42,15 +40,14 @@ public final class DuergarHedgeMage extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Duergar Hedge-Mage enters the battlefield, if you control two or more Mountains, you may destroy target artifact.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true), new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 1), rule1);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true).withInterveningIf(condition);
|
||||
ability.addTarget(new TargetArtifactPermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
// When Duergar Hedge-Mage enters the battlefield, if you control two or more Plains, you may destroy target enchantment.
|
||||
Ability ability2 = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true), new PermanentsOnTheBattlefieldCondition(filter2, ComparisonType.MORE_THAN, 1), rule2);
|
||||
ability2.addTarget(new TargetEnchantmentPermanent());
|
||||
this.addAbility(ability2);
|
||||
|
||||
ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true).withInterveningIf(condition2);
|
||||
ability.addTarget(new TargetEnchantmentPermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private DuergarHedgeMage(final DuergarHedgeMage card) {
|
||||
|
|
|
|||
|
|
@ -4,11 +4,9 @@ import mage.MageInt;
|
|||
import mage.abilities.common.LandfallAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.keyword.TheRingTemptsYouEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
|
|
@ -23,15 +21,13 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class DunedainRangers extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent();
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent("you don't control a Ring-bearer");
|
||||
|
||||
static {
|
||||
filter.add(RingBearerPredicate.instance);
|
||||
}
|
||||
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||
filter, ComparisonType.EQUAL_TO, 0
|
||||
);
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.EQUAL_TO, 0);
|
||||
|
||||
public DunedainRangers(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
|
||||
|
|
@ -42,11 +38,7 @@ public final class DunedainRangers extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Landfall -- Whenever a land you control enters, if you don't control a Ring-bearer, the Ring tempts you.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new LandfallAbility(new TheRingTemptsYouEffect()),
|
||||
condition, "Whenever a land you control enters, " +
|
||||
"if you don't control a Ring-bearer, the Ring tempts you."
|
||||
).setAbilityWord(AbilityWord.LANDFALL));
|
||||
this.addAbility(new LandfallAbility(new TheRingTemptsYouEffect()).withInterveningIf(condition));
|
||||
}
|
||||
|
||||
private DunedainRangers(final DunedainRangers card) {
|
||||
|
|
|
|||
|
|
@ -1,32 +1,28 @@
|
|||
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.condition.common.DealtDamageToAnOpponent;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.ProtectionAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX
|
||||
*/
|
||||
public final class DuneriderOutlaw extends CardImpl {
|
||||
|
||||
private static final String ruleText = "At the beginning of each end step, if {this} dealt damage to an opponent this turn, put a +1/+1 counter on it.";
|
||||
|
||||
public DuneriderOutlaw(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.REBEL);
|
||||
this.subtype.add(SubType.ROGUE);
|
||||
|
|
@ -37,9 +33,14 @@ public final class DuneriderOutlaw extends CardImpl {
|
|||
|
||||
// Protection from green
|
||||
this.addAbility(ProtectionAbility.from(ObjectColor.GREEN));
|
||||
|
||||
// At the beginning of each end step, if Dunerider Outlaw dealt damage to an opponent this turn, put a +1/+1 counter on it.
|
||||
TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of each end step", true, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(triggered, new DealtDamageToAnOpponent(), ruleText));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.ANY,
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance())
|
||||
.setText("put a +1/+1 counter on it"),
|
||||
false, DealtDamageToAnOpponent.instance
|
||||
));
|
||||
}
|
||||
|
||||
private DuneriderOutlaw(final DuneriderOutlaw card) {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
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.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.game.permanent.token.ElfWarriorToken;
|
||||
|
|
@ -21,13 +21,14 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class DwynensElite extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("another Elf");
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent(SubType.ELF, "you control another Elf");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
filter.add(SubType.ELF.getPredicate());
|
||||
}
|
||||
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(filter);
|
||||
|
||||
public DwynensElite(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
|
||||
this.subtype.add(SubType.ELF);
|
||||
|
|
@ -36,11 +37,7 @@ public final class DwynensElite extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// When this creature enters, if you control another Elf, create a 1/1 green Elf Warrior creature token.
|
||||
TriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ElfWarriorToken()));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
triggeredAbility,
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"When this creature enters, if you control another Elf, create a 1/1 green Elf Warrior creature token."));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ElfWarriorToken())).withInterveningIf(condition));
|
||||
}
|
||||
|
||||
private DwynensElite(final DwynensElite card) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
|
||||
|
|
@ -9,24 +7,25 @@ import mage.abilities.common.SimpleActivatedAbility;
|
|||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.IntPlusDynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Cguy7777
|
||||
*/
|
||||
|
|
@ -45,12 +44,10 @@ public final class EDELonesomeEyebot extends CardImpl {
|
|||
|
||||
// ED-E My Love -- Whenever you attack, if the number of attacking creatures is greater than the number of quest counters on
|
||||
// ED-E, Lonesome Eyebot, put a quest counter on it.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new AttacksWithCreaturesTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), 1),
|
||||
EDELonesomeEyebotCondition.instance,
|
||||
"Whenever you attack, if the number of attacking creatures is " +
|
||||
"greater than the number of quest counters on {this}, put a quest counter on it."
|
||||
).withFlavorWord("ED-E My Love"));
|
||||
this.addAbility(new AttacksWithCreaturesTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.QUEST.createInstance())
|
||||
.setText("put a quest counter on it"), 1
|
||||
).withInterveningIf(EDELonesomeEyebotCondition.instance).withFlavorWord("ED-E My Love"));
|
||||
|
||||
// {2}, Sacrifice ED-E: Draw a card, then draw an additional card for each quest counter on ED-E.
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
|
|
@ -81,10 +78,12 @@ enum EDELonesomeEyebotCondition implements Condition {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
return permanent != null
|
||||
&& attackingCreatureCount.calculate(game, source, null) > permanent.getCounters(game).getCount(CounterType.QUEST);
|
||||
}
|
||||
|
||||
return attackingCreatureCount.calculate(game, source, null) > permanent.getCounters(game).getCount(CounterType.QUEST);
|
||||
@Override
|
||||
public String toString() {
|
||||
return "the number of attacking creatures is greater than the number of quest counters on {this}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.ProwlCostWasPaidCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.search.SearchLibraryAndExileTargetEffect;
|
||||
import mage.abilities.hint.common.ProwlCostWasPaidHint;
|
||||
import mage.abilities.keyword.ProwlAbility;
|
||||
|
|
@ -33,16 +32,11 @@ public final class EarwigSquad extends CardImpl {
|
|||
this.addAbility(new ProwlAbility("{2}{B}"));
|
||||
|
||||
// When Earwig Squad enters the battlefield, if its prowl cost was paid, search target opponent's library for three cards and exile them. Then that player shuffles their library.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(
|
||||
new SearchLibraryAndExileTargetEffect(3, true), false
|
||||
), ProwlCostWasPaidCondition.instance, "When {this} enters, " +
|
||||
"if its prowl cost was paid, search target opponent's library for three cards " +
|
||||
"and exile them. Then that player shuffles."
|
||||
);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||
new SearchLibraryAndExileTargetEffect(3, true), false
|
||||
).withInterveningIf(ProwlCostWasPaidCondition.instance);
|
||||
ability.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability.addHint(ProwlCostWasPaidHint.instance));
|
||||
|
||||
}
|
||||
|
||||
private EarwigSquad(final EarwigSquad card) {
|
||||
|
|
|
|||
|
|
@ -2,14 +2,13 @@ package mage.cards.e;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.CompletedDungeonCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.keyword.VentureIntoTheDungeonEffect;
|
||||
import mage.abilities.hint.common.CurrentDungeonHint;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
|
|
@ -41,13 +40,8 @@ public final class EccentricApprentice extends CardImpl {
|
|||
.addHint(CurrentDungeonHint.instance));
|
||||
|
||||
// At the beginning of combat on your turn, if you've completed a dungeon, up to one target creature becomes a Bird with base power and toughness 1/1 and flying until end of turn.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(
|
||||
new EccentricApprenticeEffect()
|
||||
), CompletedDungeonCondition.instance, "At the beginning of combat on your turn, " +
|
||||
"if you've completed a dungeon, up to one target creature becomes a Bird " +
|
||||
"with base power and toughness 1/1 and flying until end of turn."
|
||||
).addHint(CompletedDungeonCondition.getHint());
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(new EccentricApprenticeEffect())
|
||||
.withInterveningIf(CompletedDungeonCondition.instance).addHint(CompletedDungeonCondition.getHint());
|
||||
ability.addTarget(new TargetCreaturePermanent(0, 1));
|
||||
this.addAbility(ability, new CompletedDungeonWatcher());
|
||||
}
|
||||
|
|
@ -66,6 +60,7 @@ class EccentricApprenticeEffect extends ContinuousEffectImpl {
|
|||
|
||||
EccentricApprenticeEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.Benefit);
|
||||
staticText = "up to one target creature becomes a Bird with base power and toughness 1/1 and flying until end of turn";
|
||||
}
|
||||
|
||||
private EccentricApprenticeEffect(final EccentricApprenticeEffect effect) {
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.condition.common.SourceOnBattlefieldOrCommandZoneCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersAllEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
|
|
@ -44,15 +42,10 @@ public final class EdgarMarkov extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Eminence - Whenever you cast another Vampire spell, if Edgar Markov is in the command zone or on the battlefield, create a 1/1 black Vampire creature token.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new SpellCastControllerTriggeredAbility(
|
||||
Zone.ALL, new CreateTokenEffect(new EdgarMarkovToken()),
|
||||
filter2, false, SetTargetPointer.NONE
|
||||
),
|
||||
SourceOnBattlefieldOrCommandZoneCondition.instance,
|
||||
"Whenever you cast another Vampire spell, if {this} is in the command zone or on the battlefield, create a 1/1 black Vampire creature token.");
|
||||
ability.setAbilityWord(AbilityWord.EMINENCE);
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new SpellCastControllerTriggeredAbility(
|
||||
Zone.ALL, new CreateTokenEffect(new EdgarMarkovToken()),
|
||||
filter2, false, SetTargetPointer.NONE
|
||||
).withInterveningIf(SourceOnBattlefieldOrCommandZoneCondition.instance).setAbilityWord(AbilityWord.EMINENCE));
|
||||
|
||||
// First strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ 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.CreateTokenCopyTargetEffect;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -32,11 +31,7 @@ public final class ElvishHydromancer extends CardImpl {
|
|||
this.addAbility(new KickerAbility("{3}{U}"));
|
||||
|
||||
// When Elvish Hydromancer enters the battlefield, if it was kicked, create a token that's a copy of target creature you control.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new CreateTokenCopyTargetEffect()),
|
||||
KickedCondition.ONCE, "When {this} enters, " +
|
||||
"if it was kicked, create a token that's a copy of target creature you control."
|
||||
);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new CreateTokenCopyTargetEffect()).withInterveningIf(KickedCondition.ONCE);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.MorbidCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.hint.common.MorbidHint;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
|
@ -16,24 +12,25 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.game.permanent.token.SpiritWhiteToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public final class EmissaryOfTheSleepless extends CardImpl {
|
||||
|
||||
public EmissaryOfTheSleepless(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
|
||||
// When Emissary of the Sleepless enters the battlefield, if a creature died this turn, create a 1/1 white Spirit creature token with flying.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken()));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, MorbidCondition.instance, "When {this} enters, if a creature died this turn, create a 1/1 white Spirit creature token with flying.").addHint(MorbidHint.instance));
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken()))
|
||||
.withInterveningIf(MorbidCondition.instance).addHint(MorbidHint.instance));
|
||||
}
|
||||
|
||||
private EmissaryOfTheSleepless(final EmissaryOfTheSleepless card) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.cards.e;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.condition.common.ControlsCreatureGreatestPowerCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.hint.ConditionHint;
|
||||
import mage.abilities.hint.Hint;
|
||||
|
|
@ -40,12 +39,8 @@ public final class EomerOfTheRiddermark extends CardImpl {
|
|||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// Whenever Eomer of the Riddermark attacks, if you control a creature with the greatest power among creatures on the battlefield, create a 1/1 white Human Soldier creature token.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new AttacksTriggeredAbility(new CreateTokenEffect(new HumanSoldierToken())),
|
||||
ControlsCreatureGreatestPowerCondition.instance, "Whenever {this} attacks, " +
|
||||
"if you control a creature with the greatest power among creatures on the battlefield, " +
|
||||
"create a 1/1 white Human Soldier creature token."
|
||||
).addHint(hint));
|
||||
this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new HumanSoldierToken()))
|
||||
.withInterveningIf(ControlsCreatureGreatestPowerCondition.instance).addHint(hint));
|
||||
}
|
||||
|
||||
private EomerOfTheRiddermark(final EomerOfTheRiddermark 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.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControllerEffect;
|
||||
|
|
@ -43,12 +42,8 @@ public final class EonFrolicker extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Eon Frolicker enters the battlefield, if you cast it, target opponent takes an extra turn after this one. Until your next turn, you and planeswalkers you control gain protection from that player.
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new EonFrolickerEffect()),
|
||||
CastFromEverywhereSourceCondition.instance, "When {this} enters, " +
|
||||
"if you cast it, target opponent takes an extra turn after this one. Until your next turn, " +
|
||||
"you and planeswalkers you control gain protection from that player."
|
||||
);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new EonFrolickerEffect())
|
||||
.withInterveningIf(CastFromEverywhereSourceCondition.instance);
|
||||
ability.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -67,6 +62,8 @@ class EonFrolickerEffect extends OneShotEffect {
|
|||
|
||||
EonFrolickerEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "target opponent takes an extra turn after this one. Until your next turn, " +
|
||||
"you and planeswalkers you control gain protection from that player";
|
||||
}
|
||||
|
||||
private EonFrolickerEffect(final EonFrolickerEffect effect) {
|
||||
|
|
|
|||
|
|
@ -3,15 +3,13 @@ package mage.cards.e;
|
|||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
|
|
@ -25,16 +23,17 @@ import mage.watchers.Watcher;
|
|||
import java.util.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Susucr
|
||||
*/
|
||||
public final class EowynShieldmaiden extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent(SubType.HUMAN, "Humans");
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||
new FilterPermanent(SubType.HUMAN, ""), ComparisonType.MORE_THAN, 5
|
||||
);
|
||||
|
||||
public EowynShieldmaiden(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{R}{W}");
|
||||
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.KNIGHT);
|
||||
|
|
@ -48,27 +47,14 @@ public final class EowynShieldmaiden extends CardImpl {
|
|||
// if another Human entered the battlefield under your control this turn,
|
||||
// create two 2/2 red Human Knight creature tokens with trample and haste.
|
||||
// Then if you control six or more Humans, draw a card.
|
||||
|
||||
TriggeredAbility triggeredAbility = new BeginningOfCombatTriggeredAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
TargetController.YOU, new CreateTokenEffect(new HumanKnightToken(), 2),
|
||||
false
|
||||
);
|
||||
triggeredAbility.addEffect(new ConditionalOneShotEffect(
|
||||
new DrawCardSourceControllerEffect(1),
|
||||
new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 5)
|
||||
Ability ability = new BeginningOfCombatTriggeredAbility(
|
||||
TargetController.YOU, new CreateTokenEffect(new HumanKnightToken(), 2), false
|
||||
).withInterveningIf(EowynShieldmaidenCondition.instance);
|
||||
ability.addEffect(new ConditionalOneShotEffect(
|
||||
new DrawCardSourceControllerEffect(1), condition,
|
||||
"Then if you control six or more Humans, draw a card"
|
||||
));
|
||||
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
triggeredAbility,
|
||||
EowynShieldmaidenCondition.instance,
|
||||
"At the beginning of combat on your turn, "
|
||||
+ "if another Human entered the battlefield "
|
||||
+ "under your control this turn, create two "
|
||||
+ "2/2 red Human Knight creature tokens with "
|
||||
+ "trample and haste. "
|
||||
+ "Then if you control six or more Humans, draw a card."
|
||||
), new EowynShieldmaidenWatcher());
|
||||
this.addAbility(ability, new EowynShieldmaidenWatcher());
|
||||
}
|
||||
|
||||
private EowynShieldmaiden(final EowynShieldmaiden card) {
|
||||
|
|
@ -88,7 +74,7 @@ enum EowynShieldmaidenCondition implements Condition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
EowynShieldmaidenWatcher watcher = game.getState().getWatcher(EowynShieldmaidenWatcher.class);
|
||||
return watcher != null
|
||||
&& watcher.hasPlayerHadAnotherHumanEnterThisTurn(
|
||||
&& watcher.hasPlayerHadAnotherHumanEnterThisTurn(
|
||||
game,
|
||||
source.getSourcePermanentOrLKI(game),
|
||||
source.getControllerId());
|
||||
|
|
@ -137,11 +123,11 @@ class EowynShieldmaidenWatcher extends Watcher {
|
|||
// we do use MageObjectReference for when eowyn is entering the battlefield
|
||||
// multiple time in the same turn (flickered for instance)
|
||||
MageObjectReference sourceMOR = sourcePermanent == null ? null
|
||||
: new MageObjectReference(sourcePermanent.getId(), game);
|
||||
: new MageObjectReference(sourcePermanent.getId(), game);
|
||||
|
||||
Set<MageObjectReference> setForThePlayer = this.humanEnterings.getOrDefault(playerId, new HashSet<>());
|
||||
return setForThePlayer.stream().anyMatch(
|
||||
humanMOR -> !(humanMOR.equals(sourceMOR))
|
||||
humanMOR -> !(humanMOR.equals(sourceMOR))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,17 +2,19 @@ package mage.cards.e;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.DevotionCount;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.LoseCreatureTypeSourceEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.watchers.common.PermanentsEnteredBattlefieldWatcher;
|
||||
|
|
@ -40,13 +42,9 @@ public final class EpharaGodOfThePolis extends CardImpl {
|
|||
.addHint(DevotionCount.WU.getHint()));
|
||||
|
||||
// At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(
|
||||
Zone.BATTLEFIELD, TargetController.ANY, new DrawCardSourceControllerEffect(1),
|
||||
false
|
||||
), EpharaGodOfThePolisCondition.instance, "At the beginning of each upkeep, " +
|
||||
"if you had another creature enter the battlefield under your control last turn, draw a card."
|
||||
), new PermanentsEnteredBattlefieldWatcher());
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
TargetController.ANY, new DrawCardSourceControllerEffect(1), false
|
||||
).withInterveningIf(EpharaGodOfThePolisCondition.instance), new PermanentsEnteredBattlefieldWatcher());
|
||||
}
|
||||
|
||||
private EpharaGodOfThePolis(final EpharaGodOfThePolis card) {
|
||||
|
|
@ -71,4 +69,9 @@ enum EpharaGodOfThePolisCondition implements Condition {
|
|||
&& watcher != null
|
||||
&& watcher.anotherCreatureEnteredBattlefieldUnderPlayersControlLastTurn(sourcePermanent, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "you had another creature enter the battlefield under your control last turn";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,34 @@
|
|||
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.WinGameSourceControllerEffect;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.abilities.hint.common.CreaturesYouControlHint;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public final class EpicStruggle extends CardImpl {
|
||||
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||
new FilterControlledCreaturePermanent("you control twenty or more creatures"),
|
||||
ComparisonType.MORE_THAN, 19
|
||||
);
|
||||
|
||||
public EpicStruggle(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}");
|
||||
|
||||
// At the beginning of your upkeep, if you control twenty or more creatures, you win the game.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect()),
|
||||
new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_CONTROLLED_CREATURE, ComparisonType.MORE_THAN, 19),
|
||||
"At the beginning of your upkeep, if you control twenty or more creatures, you win the game."
|
||||
).addHint(new ValueHint("Creatures you control", new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE))));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect())
|
||||
.withInterveningIf(condition).addHint(CreaturesYouControlHint.instance));
|
||||
}
|
||||
|
||||
private EpicStruggle(final EpicStruggle card) {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.InvertCondition;
|
||||
import mage.abilities.condition.common.AttackedThisTurnSourceCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageControllerEffect;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -18,13 +15,17 @@ import mage.constants.SubType;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author awjackson
|
||||
*
|
||||
*/
|
||||
public final class ErgRaiders extends CardImpl {
|
||||
|
||||
private static final Condition condition = new InvertCondition(
|
||||
AttackedThisTurnSourceCondition.instance, "{this} didn't attack this turn"
|
||||
);
|
||||
|
||||
public ErgRaiders(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||
this.subtype.add(SubType.HUMAN, SubType.WARRIOR);
|
||||
|
|
@ -32,16 +33,10 @@ public final class ErgRaiders extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// At the beginning of your end step, if Erg Raiders didn't attack this turn, Erg Raiders deals 2 damage to you unless it came under your control this turn.
|
||||
Effect effect = new ConditionalOneShotEffect(
|
||||
new DamageControllerEffect(2),
|
||||
ErgRaidersCondition.instance,
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(new ConditionalOneShotEffect(
|
||||
new DamageControllerEffect(2), ErgRaidersCondition.instance,
|
||||
"{this} deals 2 damage to you unless it came under your control this turn"
|
||||
);
|
||||
Ability ability = new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfEndStepTriggeredAbility(effect),
|
||||
new InvertCondition(AttackedThisTurnSourceCondition.instance),
|
||||
"At the beginning of your end step, if {this} didn't attack this turn, {this} deals 2 damage to you unless it came under your control this turn.");
|
||||
this.addAbility(ability);
|
||||
)).withInterveningIf(condition));
|
||||
}
|
||||
|
||||
private ErgRaiders(final ErgRaiders card) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package mage.cards.e;
|
||||
|
||||
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.ReturnToHandTargetEffect;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -32,13 +31,11 @@ public final class ExcavationElephant extends CardImpl {
|
|||
this.addAbility(new KickerAbility("{1}{W}"));
|
||||
|
||||
// When Excavation Elephant enters the battlefield, if it was kicked, return target artifact card from your graveyard to your hand.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(
|
||||
new ReturnToHandTargetEffect(), false
|
||||
).withInterveningIf(KickedCondition.ONCE);
|
||||
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_ARTIFACT_FROM_YOUR_GRAVEYARD));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
ability, KickedCondition.ONCE,
|
||||
"When {this} enters, if it was kicked, "
|
||||
+ "return target artifact card from your graveyard to your hand."
|
||||
));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private ExcavationElephant(final ExcavationElephant card) {
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.DeliriumCondition;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.TransformSourceEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.game.permanent.token.EldraziHorrorToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
|
@ -47,11 +47,9 @@ public final class ExtricatorOfSin extends CardImpl {
|
|||
|
||||
// <i>Delirium</i> — At the beginning of your upkeep, if there are four or more card types among cards in your graveyard, transform Extricator of Sin.
|
||||
this.addAbility(new TransformAbility());
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect()),
|
||||
DeliriumCondition.instance,
|
||||
"<i>Delirium</i> — At the beginning of your upkeep, if there are four or more card types among cards in your graveyard, "
|
||||
+ " transform {this}.")
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect())
|
||||
.withInterveningIf(DeliriumCondition.instance)
|
||||
.setAbilityWord(AbilityWord.DELIRIUM)
|
||||
.addHint(CardTypesInGraveyardCount.YOU.getHint()));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public final class WhirlingDervish extends CardImpl {
|
|||
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK));
|
||||
// At the beginning of each end step, if Whirling Dervish dealt damage to an opponent this turn, put a +1/+1 counter on it.
|
||||
TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of each end step", true, new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(triggered, new DealtDamageToAnOpponent(), ruleText));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(triggered, DealtDamageToAnOpponent.instance, ruleText));
|
||||
}
|
||||
|
||||
private WhirlingDervish(final WhirlingDervish card) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import mage.util.CardUtil;
|
|||
* @author Susucr
|
||||
*/
|
||||
public enum BargainedCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
@Override
|
||||
|
|
@ -22,7 +21,6 @@ public enum BargainedCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{this} was Bargained";
|
||||
return "it was bargained";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,31 @@
|
|||
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.game.Game;
|
||||
import mage.watchers.common.PlayerDamagedBySourceWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DealtDamageToAnOpponent implements Condition {
|
||||
public enum DealtDamageToAnOpponent implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||
PlayerDamagedBySourceWatcher watcher = game.getState().getWatcher(PlayerDamagedBySourceWatcher.class, opponentId);
|
||||
if (watcher != null) {
|
||||
if (watcher.hasSourceDoneDamage(source.getSourceId(), game)) {
|
||||
return true;
|
||||
}
|
||||
if (watcher != null && watcher.hasSourceDoneDamage(source.getSourceId(), game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{this} dealt damage to an opponent this turn";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.ComparisonType;
|
||||
|
|
@ -10,8 +8,9 @@ import mage.constants.SubType;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class EnchantedSourceCondition implements Condition {
|
||||
|
|
@ -51,6 +50,6 @@ public class EnchantedSourceCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "enchanted";
|
||||
return "{this} is enchanted";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,6 @@ public enum HateCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "if an opponent lost life from source other than combat damage this turn";
|
||||
return "an opponent lost life from source other than combat damage this turn";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public enum ProwlCostWasPaidCondition implements Condition {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "this spell's prowl cost was paid";
|
||||
return "its prowl cost was paid";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,14 +12,17 @@ public enum SourceHasCountersCondition implements Condition {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentOrLKI(game);
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
return permanent
|
||||
return permanent != null
|
||||
&& permanent
|
||||
.getCounters(game)
|
||||
.values()
|
||||
.stream()
|
||||
.mapToInt(Counter::getCount)
|
||||
.anyMatch(x -> x > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{this} has counters on it";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
|
|
@ -27,12 +26,10 @@ public class VanishingAbility extends EntersBattlefieldAbility {
|
|||
public VanishingAbility(int amount) {
|
||||
super(new AddCountersSourceEffect(CounterType.TIME.createInstance(amount)));
|
||||
this.amount = amount;
|
||||
this.addSubAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(
|
||||
new RemoveCounterSourceEffect(CounterType.TIME.createInstance()), false
|
||||
), condition, "At the beginning of your upkeep, if this permanent " +
|
||||
"has a time counter on it, remove a time counter from it."
|
||||
).setRuleVisible(false));
|
||||
this.addSubAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new RemoveCounterSourceEffect(CounterType.TIME.createInstance())
|
||||
.setText("remove a time counter from it"), false
|
||||
).withInterveningIf(condition).setRuleVisible(false));
|
||||
this.addSubAbility(new VanishingTriggeredAbility());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue