mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
rework ConditionalActivatedAbility text constructor
This commit is contained in:
parent
ffe902d25e
commit
72551143a3
50 changed files with 564 additions and 661 deletions
|
|
@ -1,16 +1,15 @@
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import mage.abilities.ActivatedAbilityImpl;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.triggers.BeginningOfDrawTriggeredAbility;
|
|
||||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
||||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
|
||||||
import mage.abilities.effects.common.DamagePlayersEffect;
|
import mage.abilities.effects.common.DamagePlayersEffect;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
|
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
|
||||||
|
import mage.abilities.triggers.BeginningOfDrawTriggeredAbility;
|
||||||
|
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
|
|
@ -23,24 +22,25 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class ArmageddonClock extends CardImpl {
|
public final class ArmageddonClock extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new IsStepCondition(PhaseStep.UPKEEP, false);
|
||||||
|
|
||||||
public ArmageddonClock(UUID ownerId, CardSetInfo setInfo) {
|
public ArmageddonClock(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}");
|
||||||
|
|
||||||
// At the beginning of your upkeep, put a doom counter on Armageddon Clock.
|
// At the beginning of your upkeep, put a doom counter on Armageddon Clock.
|
||||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.DOOM.createInstance(), StaticValue.get(1), true)));
|
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.DOOM.createInstance())));
|
||||||
|
|
||||||
// At the beginning of your draw step, Armageddon Clock deals damage equal to the number of doom counters on it to each player.
|
// At the beginning of your draw step, Armageddon Clock deals damage equal to the number of doom counters on it to each player.
|
||||||
this.addAbility(new BeginningOfDrawTriggeredAbility(new DamagePlayersEffect(Outcome.Damage, new CountersSourceCount(CounterType.DOOM))
|
this.addAbility(new BeginningOfDrawTriggeredAbility(
|
||||||
.setText("{this} deals damage equal to the number of doom counters on it to each player"), false));
|
new DamagePlayersEffect(Outcome.Damage, new CountersSourceCount(CounterType.DOOM))
|
||||||
|
.setText("{this} deals damage equal to the number of doom counters on it to each player"), false
|
||||||
|
));
|
||||||
|
|
||||||
// {4}: Remove a doom counter from Armageddon Clock. Any player may activate this ability but only during any upkeep step.
|
// {4}: Remove a doom counter from Armageddon Clock. Any player may activate this ability but only during any upkeep step.
|
||||||
ActivatedAbilityImpl ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
new RemoveCounterSourceEffect(CounterType.DOOM.createInstance()), new ManaCostsImpl<>("{4}"), new IsStepCondition(PhaseStep.UPKEEP, false),
|
Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.DOOM.createInstance()), new GenericManaCost(4),
|
||||||
"{4}: Remove a doom counter from {this}. Any player may activate this ability but only during any upkeep step.");
|
condition, "any player may activate this ability but only during any upkeep step"
|
||||||
|
).setMayActivate(TargetController.ANY));
|
||||||
ability.setMayActivate(TargetController.ANY);
|
|
||||||
this.addAbility(ability);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArmageddonClock(final ArmageddonClock card) {
|
private ArmageddonClock(final ArmageddonClock card) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
|
|
@ -13,13 +12,14 @@ import mage.abilities.effects.common.PreventDamageToSourceEffect;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class BalduvianHydra extends CardImpl {
|
public final class BalduvianHydra extends CardImpl {
|
||||||
|
|
@ -35,11 +35,16 @@ public final class BalduvianHydra extends CardImpl {
|
||||||
this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P0.createInstance())));
|
this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P0.createInstance())));
|
||||||
|
|
||||||
// Remove a +1/+0 counter from Balduvian Hydra: Prevent the next 1 damage that would be dealt to Balduvian Hydra this turn.
|
// Remove a +1/+0 counter from Balduvian Hydra: Prevent the next 1 damage that would be dealt to Balduvian Hydra this turn.
|
||||||
this.addAbility(new SimpleActivatedAbility(new PreventDamageToSourceEffect(Duration.EndOfTurn, 1), new RemoveCountersSourceCost(CounterType.P1P0.createInstance())));
|
this.addAbility(new SimpleActivatedAbility(
|
||||||
|
new PreventDamageToSourceEffect(Duration.EndOfTurn, 1),
|
||||||
|
new RemoveCountersSourceCost(CounterType.P1P0.createInstance())
|
||||||
|
));
|
||||||
|
|
||||||
// {R}{R}{R}: Put a +1/+0 counter on Balduvian Hydra. Activate this ability only during your upkeep.
|
// {R}{R}{R}: Put a +1/+0 counter on Balduvian Hydra. Activate this ability only during your upkeep.
|
||||||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P0.createInstance(1)), new ManaCostsImpl<>("{R}{R}{R}"), new IsStepCondition(PhaseStep.UPKEEP), null));
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
|
new AddCountersSourceEffect(CounterType.P1P0.createInstance(1)),
|
||||||
|
new ManaCostsImpl<>("{R}{R}{R}"), IsStepCondition.getMyUpkeep()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private BalduvianHydra(final BalduvianHydra card) {
|
private BalduvianHydra(final BalduvianHydra card) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
|
|
@ -13,14 +11,12 @@ import mage.abilities.keyword.TrampleAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.PhaseStep;
|
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class BlackCarriage extends CardImpl {
|
public final class BlackCarriage extends CardImpl {
|
||||||
|
|
@ -38,9 +34,10 @@ public final class BlackCarriage extends CardImpl {
|
||||||
this.addAbility(new SimpleStaticAbility(new DontUntapInControllersUntapStepSourceEffect()));
|
this.addAbility(new SimpleStaticAbility(new DontUntapInControllersUntapStepSourceEffect()));
|
||||||
|
|
||||||
// Sacrifice a creature: Untap Black Carriage. Activate this ability only during your upkeep.
|
// Sacrifice a creature: Untap Black Carriage. Activate this ability only during your upkeep.
|
||||||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
new UntapSourceEffect(), new SacrificeTargetCost(StaticFilters.FILTER_PERMANENT_CREATURE),
|
new UntapSourceEffect(), new SacrificeTargetCost(StaticFilters.FILTER_PERMANENT_CREATURE),
|
||||||
new IsStepCondition(PhaseStep.UPKEEP), "Sacrifice a creature: Untap {this}. Activate only during your upkeep."));
|
IsStepCondition.getMyUpkeep()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private BlackCarriage(final BlackCarriage card) {
|
private BlackCarriage(final BlackCarriage card) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package mage.cards.b;
|
package mage.cards.b;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.common.CantBlockAbility;
|
import mage.abilities.common.CantBlockAbility;
|
||||||
import mage.abilities.condition.common.RaidCondition;
|
import mage.abilities.condition.common.RaidCondition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
|
@ -34,15 +33,10 @@ public final class BloodsoakedChampion extends CardImpl {
|
||||||
this.addAbility(new CantBlockAbility());
|
this.addAbility(new CantBlockAbility());
|
||||||
|
|
||||||
// <i>Raid</i> — {1}{B}: Return Bloodstained Brave from your graveyard to the battlefield. Activate this ability only if you attacked this turn.
|
// <i>Raid</i> — {1}{B}: Return Bloodstained Brave from your graveyard to the battlefield. Activate this ability only if you attacked this turn.
|
||||||
Ability ability = new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
Zone.GRAVEYARD,
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(),
|
||||||
new ReturnSourceFromGraveyardToBattlefieldEffect(),
|
new ManaCostsImpl<>("{1}{B}"), RaidCondition.instance
|
||||||
new ManaCostsImpl<>("{1}{B}"),
|
).setAbilityWord(AbilityWord.RAID).addHint(RaidHint.instance), new PlayerAttackedWatcher());
|
||||||
RaidCondition.instance,
|
|
||||||
"<i>Raid</i> — {1}{B}: Return {this} from your graveyard to the battlefield. Activate only if you attacked this turn.");
|
|
||||||
ability.setAbilityWord(AbilityWord.RAID);
|
|
||||||
ability.addHint(RaidHint.instance);
|
|
||||||
this.addAbility(ability, new PlayerAttackedWatcher());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private BloodsoakedChampion(final BloodsoakedChampion card) {
|
private BloodsoakedChampion(final BloodsoakedChampion card) {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect;
|
import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect;
|
||||||
import mage.abilities.effects.common.UntapSourceEffect;
|
import mage.abilities.effects.common.UntapSourceEffect;
|
||||||
|
|
@ -13,18 +12,20 @@ import mage.abilities.keyword.TrampleAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
import mage.constants.SubType;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public final class ColossusOfSardia extends CardImpl {
|
public final class ColossusOfSardia extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new IsStepCondition(PhaseStep.UPKEEP);
|
||||||
|
|
||||||
public ColossusOfSardia(UUID ownerId, CardSetInfo setInfo) {
|
public ColossusOfSardia(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{9}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{9}");
|
||||||
this.subtype.add(SubType.GOLEM);
|
this.subtype.add(SubType.GOLEM);
|
||||||
|
|
||||||
this.power = new MageInt(9);
|
this.power = new MageInt(9);
|
||||||
|
|
@ -37,8 +38,7 @@ public final class ColossusOfSardia extends CardImpl {
|
||||||
this.addAbility(new SimpleStaticAbility(new DontUntapInControllersUntapStepSourceEffect()));
|
this.addAbility(new SimpleStaticAbility(new DontUntapInControllersUntapStepSourceEffect()));
|
||||||
|
|
||||||
// {9}: Untap Colossus of Sardia. Activate this ability only during your upkeep.
|
// {9}: Untap Colossus of Sardia. Activate this ability only during your upkeep.
|
||||||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
this.addAbility(new ConditionalActivatedAbility(new UntapSourceEffect(), new GenericManaCost(9), condition));
|
||||||
new UntapSourceEffect(), new ManaCostsImpl<>("{9}"), new IsStepCondition(PhaseStep.UPKEEP), null));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ColossusOfSardia(final ColossusOfSardia card) {
|
private ColossusOfSardia(final ColossusOfSardia card) {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.DelayedTriggeredAbility;
|
import mage.abilities.DelayedTriggeredAbility;
|
||||||
import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility;
|
import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility;
|
||||||
import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility;
|
import mage.abilities.common.delayed.AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
|
|
@ -37,17 +38,21 @@ import java.util.*;
|
||||||
*/
|
*/
|
||||||
public final class CyclopeanTomb extends CardImpl {
|
public final class CyclopeanTomb extends CardImpl {
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterLandPermanent();
|
private static final FilterPermanent filter = new FilterLandPermanent("non-Swamp land");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(Predicates.not(SubType.SWAMP.getPredicate()));
|
filter.add(Predicates.not(SubType.SWAMP.getPredicate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Condition condition = new IsStepCondition(PhaseStep.UPKEEP);
|
||||||
|
|
||||||
public CyclopeanTomb(UUID ownerId, CardSetInfo setInfo) {
|
public CyclopeanTomb(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||||
|
|
||||||
// {2}, {tap}: Put a mire counter on target non-Swamp land. That land is a Swamp for as long as it has a mire counter on it. Activate this ability only during your upkeep.
|
// {2}, {tap}: Put a mire counter on target non-Swamp land. That land is a Swamp for as long as it has a mire counter on it. Activate this ability only during your upkeep.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.MIRE.createInstance()), new GenericManaCost(2), new IsStepCondition(PhaseStep.UPKEEP), "{2}, {T}: Put a mire counter on target non-Swamp land. That land is a Swamp for as long as it has a mire counter on it. Activate only during your upkeep.");
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
|
new AddCountersTargetEffect(CounterType.MIRE.createInstance()), new GenericManaCost(2), condition
|
||||||
|
);
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addTarget(new TargetPermanent(filter));
|
ability.addTarget(new TargetPermanent(filter));
|
||||||
ability.addEffect(new BecomeSwampEffect());
|
ability.addEffect(new BecomeSwampEffect());
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||||
import mage.abilities.condition.common.HeckbentCondition;
|
import mage.abilities.condition.common.HeckbentCondition;
|
||||||
|
|
@ -14,8 +13,9 @@ import mage.constants.SubType;
|
||||||
import mage.constants.TimingRule;
|
import mage.constants.TimingRule;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class DreadWanderer extends CardImpl {
|
public final class DreadWanderer extends CardImpl {
|
||||||
|
|
@ -33,17 +33,10 @@ public final class DreadWanderer extends CardImpl {
|
||||||
|
|
||||||
// {2}{B}: Return Dread Wanderer from your graveyard to the battlefield.
|
// {2}{B}: Return Dread Wanderer from your graveyard to the battlefield.
|
||||||
// Activate this ability only any time you could cast a sorcery and only if you have one or fewer cards in hand.
|
// Activate this ability only any time you could cast a sorcery and only if you have one or fewer cards in hand.
|
||||||
ConditionalActivatedAbility ability = new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
Zone.GRAVEYARD,
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(),
|
||||||
new ReturnSourceFromGraveyardToBattlefieldEffect(),
|
new ManaCostsImpl<>("{2}{B}"), HeckbentCondition.instance
|
||||||
new ManaCostsImpl<>("{2}{B}"),
|
).setTiming(TimingRule.SORCERY));
|
||||||
HeckbentCondition.instance,
|
|
||||||
"{2}{B}: Return {this} from your graveyard to the battlefield. "
|
|
||||||
+ "Activate only as a sorcery "
|
|
||||||
+ "and only if you have one or fewer cards in hand."
|
|
||||||
);
|
|
||||||
ability.setTiming(TimingRule.SORCERY);
|
|
||||||
addAbility(ability);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private DreadWanderer(final DreadWanderer card) {
|
private DreadWanderer(final DreadWanderer card) {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
|
@ -12,27 +12,27 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class DwarvenArmory extends CardImpl {
|
public final class DwarvenArmory extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new IsStepCondition(PhaseStep.UPKEEP, false);
|
||||||
|
|
||||||
public DwarvenArmory(UUID ownerId, CardSetInfo setInfo) {
|
public DwarvenArmory(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{R}");
|
||||||
|
|
||||||
// {2}, Sacrifice a land: Put a +2/+2 counter on target creature. Activate this ability only during any upkeep step.
|
// {2}, Sacrifice a land: Put a +2/+2 counter on target creature. Activate this ability only during any upkeep step.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new AddCountersTargetEffect(CounterType.P2P2.createInstance()),
|
new AddCountersTargetEffect(CounterType.P2P2.createInstance()),
|
||||||
new ManaCostsImpl<>("{2}"),
|
new ManaCostsImpl<>("{2}"), condition
|
||||||
new IsStepCondition(PhaseStep.UPKEEP, false),
|
);
|
||||||
null);
|
|
||||||
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_LAND));
|
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_LAND));
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,27 @@
|
||||||
|
|
||||||
package mage.cards.e;
|
package mage.cards.e;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
|
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
|
||||||
import mage.abilities.effects.common.ReturnToHandSourceEffect;
|
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.abilities.keyword.PlainscyclingAbility;
|
import mage.abilities.keyword.PlainscyclingAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.PhaseStep;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Loki
|
* @author Loki
|
||||||
*/
|
*/
|
||||||
public final class EternalDragon extends CardImpl {
|
public final class EternalDragon extends CardImpl {
|
||||||
|
|
||||||
public EternalDragon(UUID ownerId, CardSetInfo setInfo) {
|
public EternalDragon(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}{W}");
|
||||||
this.subtype.add(SubType.DRAGON);
|
this.subtype.add(SubType.DRAGON);
|
||||||
this.subtype.add(SubType.SPIRIT);
|
this.subtype.add(SubType.SPIRIT);
|
||||||
|
|
||||||
|
|
@ -36,13 +32,11 @@ public final class EternalDragon extends CardImpl {
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// {3}{W}{W}: Return Eternal Dragon from your graveyard to your hand. Activate this ability only during your upkeep.
|
// {3}{W}{W}: Return Eternal Dragon from your graveyard to your hand. Activate this ability only during your upkeep.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.GRAVEYARD,
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
new ReturnSourceFromGraveyardToHandEffect(),
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(),
|
||||||
new ManaCostsImpl<>("{3}{W}{W}"),
|
new ManaCostsImpl<>("{3}{W}{W}"), IsStepCondition.getMyUpkeep()
|
||||||
new IsStepCondition(PhaseStep.UPKEEP),
|
));
|
||||||
null
|
|
||||||
);
|
|
||||||
this.addAbility(ability);
|
|
||||||
// PlainscyclingAbility {2}
|
// PlainscyclingAbility {2}
|
||||||
this.addAbility(new PlainscyclingAbility(new ManaCostsImpl<>("{2}")));
|
this.addAbility(new PlainscyclingAbility(new ManaCostsImpl<>("{2}")));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,10 @@ import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.TargetController;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -44,7 +47,7 @@ public final class FiremaneAngel extends CardImpl {
|
||||||
// {6}{R}{R}{W}{W}: Return Firemane Angel from your graveyard to the battlefield. Activate this ability only during your upkeep.
|
// {6}{R}{R}{W}{W}: Return Firemane Angel from your graveyard to the battlefield. Activate this ability only during your upkeep.
|
||||||
this.addAbility(new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(false, false),
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(false, false),
|
||||||
new ManaCostsImpl<>("{6}{R}{R}{W}{W}"), new IsStepCondition(PhaseStep.UPKEEP), null
|
new ManaCostsImpl<>("{6}{R}{R}{W}{W}"), IsStepCondition.getMyUpkeep()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.g;
|
package mage.cards.g;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
|
|
@ -13,15 +7,9 @@ import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
|
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
|
||||||
import mage.abilities.effects.common.ReturnToHandSourceEffect;
|
import mage.cards.*;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
|
||||||
import mage.cards.CardSetInfo;
|
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.PhaseStep;
|
|
||||||
import mage.constants.WatcherScope;
|
import mage.constants.WatcherScope;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
|
|
@ -31,8 +19,9 @@ import mage.players.Player;
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class GrimReminder extends CardImpl {
|
public final class GrimReminder extends CardImpl {
|
||||||
|
|
@ -46,11 +35,8 @@ public final class GrimReminder extends CardImpl {
|
||||||
|
|
||||||
// {B}{B}: Return Grim Reminder from your graveyard to your hand. Activate this ability only during your upkeep.
|
// {B}{B}: Return Grim Reminder from your graveyard to your hand. Activate this ability only during your upkeep.
|
||||||
this.addAbility(new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
Zone.GRAVEYARD,
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(),
|
||||||
new ReturnSourceFromGraveyardToHandEffect(),
|
new ManaCostsImpl<>("{B}{B}"), IsStepCondition.getMyUpkeep()
|
||||||
new ManaCostsImpl<>("{B}{B}"),
|
|
||||||
new IsStepCondition(PhaseStep.UPKEEP),
|
|
||||||
null
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,12 +40,10 @@ public final class HallOfOracles extends CardImpl {
|
||||||
|
|
||||||
// {T}: Put a +1/+1 counter on target creature. Activate only as a sorcery and only if you've cast an instant or sorcery spell this turn.
|
// {T}: Put a +1/+1 counter on target creature. Activate only as a sorcery and only if you've cast an instant or sorcery spell this turn.
|
||||||
ability = new ConditionalActivatedAbility(
|
ability = new ConditionalActivatedAbility(
|
||||||
Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new TapSourceCost(),
|
Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
|
||||||
HallOfOraclesCondition.instance, "{T}: Put a +1/+1 counter on target creature. " +
|
new TapSourceCost(), HallOfOraclesCondition.instance
|
||||||
"Activate only as a sorcery and only if you've cast an instant or sorcery spell this turn."
|
).setTiming(TimingRule.SORCERY);
|
||||||
);
|
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
ability.setTiming(TimingRule.SORCERY);
|
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,4 +69,9 @@ enum HallOfOraclesCondition implements Condition {
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.anyMatch(spell -> spell.isInstantOrSorcery(game));
|
.anyMatch(spell -> spell.isInstantOrSorcery(game));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "you've cast an instant or sorcery spell this turn";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.h;
|
package mage.cards.h;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
|
|
@ -10,28 +8,28 @@ import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.PhaseStep;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.target.common.TargetAnyTarget;
|
import mage.target.common.TargetAnyTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public final class HammerOfBogardan extends CardImpl {
|
public final class HammerOfBogardan extends CardImpl {
|
||||||
|
|
||||||
public HammerOfBogardan(UUID ownerId, CardSetInfo setInfo) {
|
public HammerOfBogardan(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}");
|
||||||
|
|
||||||
|
|
||||||
// Hammer of Bogardan deals 3 damage to any target.
|
// Hammer of Bogardan deals 3 damage to any target.
|
||||||
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
|
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
|
||||||
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
||||||
|
|
||||||
// {2}{R}{R}{R}: Return Hammer of Bogardan from your graveyard to your hand. Activate this ability only during your upkeep.
|
// {2}{R}{R}{R}: Return Hammer of Bogardan from your graveyard to your hand. Activate this ability only during your upkeep.
|
||||||
this.addAbility(new ConditionalActivatedAbility(Zone.GRAVEYARD,
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl<>("{2}{R}{R}{R}"), new IsStepCondition(PhaseStep.UPKEEP), null));
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(),
|
||||||
|
new ManaCostsImpl<>("{2}{R}{R}{R}"), IsStepCondition.getMyUpkeep()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private HammerOfBogardan(final HammerOfBogardan card) {
|
private HammerOfBogardan(final HammerOfBogardan card) {
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,8 @@ package mage.cards.h;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.condition.Condition;
|
|
||||||
import mage.abilities.condition.common.MeldCondition;
|
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
|
||||||
import mage.abilities.effects.common.MeldEffect;
|
import mage.abilities.effects.common.MeldEffect;
|
||||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||||
import mage.abilities.keyword.HasteAbility;
|
import mage.abilities.keyword.HasteAbility;
|
||||||
|
|
@ -15,7 +12,6 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -25,8 +21,6 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class HanweirBattlements extends CardImpl {
|
public final class HanweirBattlements extends CardImpl {
|
||||||
|
|
||||||
private static final Condition condition = new MeldCondition("Hanweir Garrison");
|
|
||||||
|
|
||||||
public HanweirBattlements(UUID ownerId, CardSetInfo setInfo) {
|
public HanweirBattlements(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||||
|
|
||||||
|
|
@ -36,7 +30,7 @@ public final class HanweirBattlements extends CardImpl {
|
||||||
// {T}: Add {C}.
|
// {T}: Add {C}.
|
||||||
this.addAbility(new ColorlessManaAbility());
|
this.addAbility(new ColorlessManaAbility());
|
||||||
|
|
||||||
// {R},{T}: Target creature gains haste until end of turn.
|
// {R}, {T}: Target creature gains haste until end of turn.
|
||||||
Ability ability = new SimpleActivatedAbility(new GainAbilityTargetEffect(
|
Ability ability = new SimpleActivatedAbility(new GainAbilityTargetEffect(
|
||||||
HasteAbility.getInstance(), Duration.EndOfTurn
|
HasteAbility.getInstance(), Duration.EndOfTurn
|
||||||
), new ManaCostsImpl<>("{R}"));
|
), new ManaCostsImpl<>("{R}"));
|
||||||
|
|
@ -44,11 +38,12 @@ public final class HanweirBattlements extends CardImpl {
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// {3}{R}{R},{T}: If you both own and control Hanweir Battlements and a creature named Hanweir Garrison, exile them, then meld them into Hanweir, the Writhing Township.
|
// {3}{R}{R}, {T}: If you both own and control Hanweir Battlements and a creature named Hanweir Garrison, exile them, then meld them into Hanweir, the Writhing Township.
|
||||||
ability = new ConditionalActivatedAbility(
|
ability = new SimpleActivatedAbility(
|
||||||
Zone.BATTLEFIELD, new MeldEffect("Hanweir Garrison", "Hanweir, the Writhing Township"),
|
new MeldEffect("Hanweir Garrison", "Hanweir, the Writhing Township")
|
||||||
new ManaCostsImpl<>("{3}{R}{R}"), condition, "{3}{R}{R}, {T}: If you both own and control {this} " +
|
.setText("if you both own and control {this} and a creature named Hanweir Garrison, " +
|
||||||
"and a creature named Hanweir Garrison, exile them, then meld them into Hanweir, the Writhing Township."
|
"exile them, then meld them into Hanweir, the Writhing Township"),
|
||||||
|
new ManaCostsImpl<>("{3}{R}{R}")
|
||||||
);
|
);
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
|
|
||||||
package mage.cards.h;
|
package mage.cards.h;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
|
||||||
import mage.abilities.Ability;
|
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||||
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
|
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
|
||||||
|
|
@ -13,35 +11,36 @@ import mage.abilities.effects.common.continuous.BoostEquippedEffect;
|
||||||
import mage.abilities.keyword.EquipAbility;
|
import mage.abilities.keyword.EquipAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.*;
|
||||||
import mage.constants.SubType;
|
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||||
import mage.constants.ComparisonType;
|
import mage.game.permanent.token.custom.CreatureToken;
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Outcome;
|
import java.util.UUID;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.StaticFilters;
|
|
||||||
import mage.game.permanent.token.TokenImpl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Plopman
|
* @author Plopman
|
||||||
*/
|
*/
|
||||||
public final class HauntedPlateMail extends CardImpl {
|
public final class HauntedPlateMail extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||||
|
new FilterControlledCreaturePermanent("you control no creatures"), ComparisonType.EQUAL_TO, 0
|
||||||
|
);
|
||||||
|
|
||||||
public HauntedPlateMail(UUID ownerId, CardSetInfo setInfo) {
|
public HauntedPlateMail(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||||
this.subtype.add(SubType.EQUIPMENT);
|
this.subtype.add(SubType.EQUIPMENT);
|
||||||
|
|
||||||
// Equipped creature gets +4/+4.
|
// Equipped creature gets +4/+4.
|
||||||
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(4, 4)));
|
this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(4, 4)));
|
||||||
|
|
||||||
// {0}: Until end of turn, Haunted Plate Mail becomes a 4/4 Spirit artifact creature that's no longer an Equipment. Activate this ability only if you control no creatures.
|
// {0}: Until end of turn, Haunted Plate Mail becomes a 4/4 Spirit artifact creature that's no longer an Equipment. Activate this ability only if you control no creatures.
|
||||||
Ability ability = new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(new BecomesCreatureSourceEffect(
|
||||||
Zone.BATTLEFIELD,
|
new CreatureToken(
|
||||||
new BecomesCreatureSourceEffect(new HauntedPlateMailToken(), CardType.ARTIFACT, Duration.EndOfTurn).andNotEquipment(true),
|
4, 4, "4/4 Spirit artifact " +
|
||||||
new ManaCostsImpl<>("{0}"),
|
"creature that's no longer an Equipment", SubType.SPIRIT
|
||||||
new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_PERMANENT_CREATURE, ComparisonType.EQUAL_TO, 0),
|
).withType(CardType.ARTIFACT), CardType.ARTIFACT, Duration.EndOfTurn
|
||||||
"{0}: Until end of turn, Haunted Plate Mail becomes a 4/4 Spirit artifact creature that's no longer an Equipment. Activate only if you control no creatures.");
|
).andNotEquipment(true).withDurationRuleAtStart(true), new GenericManaCost(0), condition));
|
||||||
this.addAbility(ability);
|
|
||||||
// Equip {4}
|
// Equip {4}
|
||||||
this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl<>("{4}")));
|
this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl<>("{4}")));
|
||||||
}
|
}
|
||||||
|
|
@ -55,22 +54,3 @@ public final class HauntedPlateMail extends CardImpl {
|
||||||
return new HauntedPlateMail(this);
|
return new HauntedPlateMail(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class HauntedPlateMailToken extends TokenImpl {
|
|
||||||
|
|
||||||
public HauntedPlateMailToken() {
|
|
||||||
super("Spirit", "4/4 Spirit artifact creature that's no longer an Equipment");
|
|
||||||
cardType.add(CardType.ARTIFACT);
|
|
||||||
cardType.add(CardType.CREATURE);
|
|
||||||
subtype.add(SubType.SPIRIT);
|
|
||||||
power = new MageInt(4);
|
|
||||||
toughness = new MageInt(4);
|
|
||||||
}
|
|
||||||
private HauntedPlateMailToken(final HauntedPlateMailToken token) {
|
|
||||||
super(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
public HauntedPlateMailToken copy() {
|
|
||||||
return new HauntedPlateMailToken(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
|
|
||||||
package mage.cards.h;
|
package mage.cards.h;
|
||||||
|
|
||||||
import java.util.UUID;
|
import mage.MageItem;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.condition.Condition;
|
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.CreateTokenEffect;
|
|
||||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||||
import mage.abilities.keyword.EquipAbility;
|
import mage.abilities.keyword.EquipAbility;
|
||||||
import mage.abilities.keyword.FirstStrikeAbility;
|
import mage.abilities.keyword.FirstStrikeAbility;
|
||||||
|
|
@ -19,51 +14,49 @@ import mage.abilities.keyword.TrampleAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.filter.common.FilterControlledArtifactPermanent;
|
import mage.filter.FilterPermanent;
|
||||||
|
import mage.filter.common.FilterControlledPermanent;
|
||||||
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.NamePredicate;
|
import mage.filter.predicate.mageobject.NamePredicate;
|
||||||
|
import mage.filter.predicate.permanent.PermanentIdPredicate;
|
||||||
|
import mage.game.Controllable;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.token.KaldraToken;
|
import mage.game.permanent.token.KaldraToken;
|
||||||
|
import mage.game.permanent.token.Token;
|
||||||
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.util.RandomUtil;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class HelmOfKaldra extends CardImpl {
|
public final class HelmOfKaldra extends CardImpl {
|
||||||
|
|
||||||
static final FilterControlledArtifactPermanent filterHelm = new FilterControlledArtifactPermanent();
|
|
||||||
static final FilterControlledArtifactPermanent filterShield = new FilterControlledArtifactPermanent();
|
|
||||||
static final FilterControlledArtifactPermanent filterSword = new FilterControlledArtifactPermanent();
|
|
||||||
|
|
||||||
static {
|
|
||||||
filterHelm.add(new NamePredicate("Helm of Kaldra"));
|
|
||||||
filterShield.add(new NamePredicate("Shield of Kaldra"));
|
|
||||||
filterSword.add(new NamePredicate("Sword of Kaldra"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public HelmOfKaldra(UUID ownerId, CardSetInfo setInfo) {
|
public HelmOfKaldra(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||||
this.supertype.add(SuperType.LEGENDARY);
|
this.supertype.add(SuperType.LEGENDARY);
|
||||||
this.subtype.add(SubType.EQUIPMENT);
|
this.subtype.add(SubType.EQUIPMENT);
|
||||||
|
|
||||||
// Equipped creature has first strike, trample, and haste.
|
// Equipped creature has first strike, trample, and haste.
|
||||||
Ability ability = new SimpleStaticAbility(new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT));
|
Ability ability = new SimpleStaticAbility(new GainAbilityAttachedEffect(
|
||||||
Effect effect = new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT);
|
FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT
|
||||||
effect.setText(", trample");
|
));
|
||||||
ability.addEffect(effect);
|
ability.addEffect(new GainAbilityAttachedEffect(
|
||||||
effect = new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT);
|
TrampleAbility.getInstance(), AttachmentType.EQUIPMENT
|
||||||
effect.setText(", and haste");
|
).setText(", trample"));
|
||||||
ability.addEffect(effect);
|
ability.addEffect(new GainAbilityAttachedEffect(
|
||||||
|
HasteAbility.getInstance(), AttachmentType.EQUIPMENT
|
||||||
|
).setText(", and haste"));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// {1}: If you control Equipment named Helm of Kaldra, Sword of Kaldra, and Shield of Kaldra, create a legendary 4/4 colorless Avatar creature token named Kaldra and attach those Equipment to it.
|
// {1}: If you control Equipment named Helm of Kaldra, Sword of Kaldra, and Shield of Kaldra, create a legendary 4/4 colorless Avatar creature token named Kaldra and attach those Equipment to it.
|
||||||
this.addAbility(new ConditionalActivatedAbility(
|
this.addAbility(new SimpleActivatedAbility(new HelmOfKaldraEffect(), new GenericManaCost(1)));
|
||||||
Zone.BATTLEFIELD,
|
|
||||||
new HelmOfKaldraEffect(),
|
|
||||||
new GenericManaCost(1),
|
|
||||||
new HelmOfKaldraCondition(),
|
|
||||||
"{1}: If you control Equipment named Helm of Kaldra, Sword of Kaldra, and Shield of Kaldra, create Kaldra, a legendary 4/4 colorless Avatar creature token. Attach those Equipment to it."));
|
|
||||||
// Equip {2}
|
// Equip {2}
|
||||||
this.addAbility(new EquipAbility(Outcome.Benefit, new ManaCostsImpl<>("{2}"), false));
|
this.addAbility(new EquipAbility(2, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private HelmOfKaldra(final HelmOfKaldra card) {
|
private HelmOfKaldra(final HelmOfKaldra card) {
|
||||||
|
|
@ -76,26 +69,22 @@ public final class HelmOfKaldra extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class HelmOfKaldraCondition implements Condition {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
if (game.getBattlefield().count(HelmOfKaldra.filterHelm, source.getControllerId(), source, game) < 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (game.getBattlefield().count(HelmOfKaldra.filterSword, source.getControllerId(), source, game) < 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return game.getBattlefield().count(HelmOfKaldra.filterShield, source.getControllerId(), source, game) >= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class HelmOfKaldraEffect extends OneShotEffect {
|
class HelmOfKaldraEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
private static final FilterPermanent filterHelm = new FilterControlledPermanent(SubType.EQUIPMENT);
|
||||||
|
private static final FilterPermanent filterSword = new FilterControlledPermanent(SubType.EQUIPMENT);
|
||||||
|
private static final FilterPermanent filterShield = new FilterControlledPermanent(SubType.EQUIPMENT);
|
||||||
|
|
||||||
|
static {
|
||||||
|
filterHelm.add(new NamePredicate("Helm of Kaldra"));
|
||||||
|
filterSword.add(new NamePredicate("Sword of Kaldra"));
|
||||||
|
filterShield.add(new NamePredicate("Shield of Kaldra"));
|
||||||
|
}
|
||||||
|
|
||||||
HelmOfKaldraEffect() {
|
HelmOfKaldraEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "if you control Equipment named Helm of Kaldra, Sword of Kaldra, and Shield of Kaldra, create Kaldra, a legendary 4/4 colorless Avatar creature token. Attach those Equipment to it";
|
this.staticText = "if you control Equipment named Helm of Kaldra, Sword of Kaldra, and Shield of Kaldra, " +
|
||||||
|
"create Kaldra, a legendary 4/4 colorless Avatar creature token. Attach those Equipment to it";
|
||||||
}
|
}
|
||||||
|
|
||||||
private HelmOfKaldraEffect(final HelmOfKaldraEffect effect) {
|
private HelmOfKaldraEffect(final HelmOfKaldraEffect effect) {
|
||||||
|
|
@ -109,32 +98,53 @@ class HelmOfKaldraEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
if (new HelmOfKaldraCondition().apply(game, source)) {
|
if (!game.getBattlefield().contains(filterHelm, source, game, 1)
|
||||||
CreateTokenEffect effect = new CreateTokenEffect(new KaldraToken());
|
|| !game.getBattlefield().contains(filterSword, source, game, 1)
|
||||||
effect.apply(game, source);
|
|| !game.getBattlefield().contains(filterShield, source, game, 1)) {
|
||||||
for (UUID tokenId : effect.getLastAddedTokenIds()) {
|
return false;
|
||||||
Permanent kaldra = game.getPermanent(tokenId);
|
|
||||||
if (kaldra != null) {
|
|
||||||
// Attach helm to the token
|
|
||||||
for (Permanent kaldrasHelm : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterHelm, source.getControllerId(), game)) {
|
|
||||||
kaldra.addAttachment(kaldrasHelm.getId(), source, game);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// Attach shield to the token
|
|
||||||
for (Permanent kaldrasShield : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterShield, source.getControllerId(), game)) {
|
|
||||||
kaldra.addAttachment(kaldrasShield.getId(), source, game);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// Attach sword to the token
|
|
||||||
for (Permanent kaldrasSword : game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterSword, source.getControllerId(), game)) {
|
|
||||||
kaldra.addAttachment(kaldrasSword.getId(), source, game);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
Token token = new KaldraToken();
|
||||||
|
token.putOntoBattlefield(1, game, source);
|
||||||
|
Set<Permanent> permanents = token
|
||||||
|
.getLastAddedTokenIds()
|
||||||
|
.stream()
|
||||||
|
.map(game::getPermanent)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
Permanent permanent;
|
||||||
|
switch (permanents.size()) {
|
||||||
|
case 0:
|
||||||
|
return true;
|
||||||
|
case 1:
|
||||||
|
permanent = RandomUtil.randomFromCollection(permanents);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
FilterPermanent filter = new FilterPermanent();
|
||||||
|
filter.add(Predicates.or(
|
||||||
|
permanents.stream()
|
||||||
|
.map(MageItem::getId)
|
||||||
|
.map(PermanentIdPredicate::new)
|
||||||
|
.collect(Collectors.toSet())
|
||||||
|
));
|
||||||
|
TargetPermanent target = new TargetPermanent(filter);
|
||||||
|
target.withNotTarget(true);
|
||||||
|
target.withChooseHint("to equip");
|
||||||
|
Optional.ofNullable(source)
|
||||||
|
.map(Controllable::getControllerId)
|
||||||
|
.map(game::getPlayer)
|
||||||
|
.ifPresent(player -> player.choose(outcome, target, source, game));
|
||||||
|
permanent = game.getPermanent(target.getFirstTarget());
|
||||||
|
}
|
||||||
|
if (permanent == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Set<Permanent> equipments = new HashSet<>();
|
||||||
|
equipments.addAll(game.getBattlefield().getActivePermanents(filterHelm, source.getControllerId(), source, game));
|
||||||
|
equipments.addAll(game.getBattlefield().getActivePermanents(filterSword, source.getControllerId(), source, game));
|
||||||
|
equipments.addAll(game.getBattlefield().getActivePermanents(filterShield, source.getControllerId(), source, game));
|
||||||
|
for (Permanent equipment : equipments) {
|
||||||
|
permanent.addAttachment(equipment.getId(), source, game);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,35 @@
|
||||||
|
|
||||||
package mage.cards.j;
|
package mage.cards.j;
|
||||||
|
|
||||||
import java.util.UUID;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.MageInt;
|
|
||||||
import mage.abilities.condition.common.IsPhaseCondition;
|
import mage.abilities.condition.common.IsPhaseCondition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
|
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.TurnPhase;
|
import mage.constants.TurnPhase;
|
||||||
import mage.constants.Zone;
|
import mage.game.permanent.token.custom.CreatureToken;
|
||||||
import mage.game.permanent.token.TokenImpl;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author anonymous
|
* @author anonymous
|
||||||
*/
|
*/
|
||||||
public final class JadeStatue extends CardImpl {
|
public final class JadeStatue extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new IsPhaseCondition(TurnPhase.COMBAT);
|
||||||
|
|
||||||
public JadeStatue(UUID ownerId, CardSetInfo setInfo) {
|
public JadeStatue(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||||
|
|
||||||
|
|
||||||
// {2}: Jade Statue becomes a 3/6 Golem artifact creature until end of combat. Activate this ability only during combat.
|
// {2}: Jade Statue becomes a 3/6 Golem artifact creature until end of combat. Activate this ability only during combat.
|
||||||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect (new JadeStatueToken(), CardType.ARTIFACT, Duration.EndOfCombat), new ManaCostsImpl<>("{2}"), new IsPhaseCondition(TurnPhase.COMBAT), "{2}: {this} becomes a 3/6 Golem artifact creature until end of combat. Activate only during combat."));
|
this.addAbility(new ConditionalActivatedAbility(new BecomesCreatureSourceEffect(
|
||||||
|
new CreatureToken(3, 6, "3/6 Golem artifact creature", SubType.GOLEM)
|
||||||
|
.withType(CardType.ARTIFACT), CardType.ARTIFACT, Duration.EndOfCombat
|
||||||
|
), new GenericManaCost(2), condition));
|
||||||
}
|
}
|
||||||
|
|
||||||
private JadeStatue(final JadeStatue card) {
|
private JadeStatue(final JadeStatue card) {
|
||||||
|
|
@ -38,22 +40,4 @@ public final class JadeStatue extends CardImpl {
|
||||||
public JadeStatue copy() {
|
public JadeStatue copy() {
|
||||||
return new JadeStatue(this);
|
return new JadeStatue(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class JadeStatueToken extends TokenImpl {
|
|
||||||
JadeStatueToken() {
|
|
||||||
super("", "3/6 Golem artifact creature");
|
|
||||||
cardType.add(CardType.ARTIFACT);
|
|
||||||
cardType.add(CardType.CREATURE);
|
|
||||||
this.subtype.add(SubType.GOLEM);
|
|
||||||
power = new MageInt(3);
|
|
||||||
toughness = new MageInt(6);
|
|
||||||
}
|
|
||||||
private JadeStatueToken(final JadeStatueToken token) {
|
|
||||||
super(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
public JadeStatueToken copy() {
|
|
||||||
return new JadeStatueToken(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,44 +1,46 @@
|
||||||
|
|
||||||
package mage.cards.j;
|
package mage.cards.j;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
import mage.abilities.costs.common.DiscardTargetCost;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
|
||||||
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
|
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.WatcherScope;
|
import mage.constants.WatcherScope;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
import mage.filter.predicate.Predicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.players.Player;
|
import mage.target.common.TargetCardInHand;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author MarcoMarin
|
* @author MarcoMarin
|
||||||
*/
|
*/
|
||||||
public final class JandorsRing extends CardImpl {
|
public final class JandorsRing extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterCard filter = new FilterCard("the last card you drew this turn");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(JandorsRingPredicate.instance);
|
||||||
|
}
|
||||||
|
|
||||||
public JandorsRing(UUID ownerId, CardSetInfo setInfo) {
|
public JandorsRing(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}");
|
||||||
|
|
||||||
Watcher watcher = new JandorsRingWatcher();
|
|
||||||
// {2}, {tap}, Discard the last card you drew this turn: Draw a card.
|
// {2}, {tap}, Discard the last card you drew this turn: Draw a card.
|
||||||
// TODO: discard has to be a cost not a payment during resolution
|
Ability ability = new SimpleActivatedAbility(new DrawCardSourceControllerEffect(1), new GenericManaCost(2));
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new JandorsRingEffect(), new ManaCostsImpl<>("{2}"), WatchedCardInHandCondition.instance, "{2}, {T}, Discard the last card you drew this turn: Draw a card.");
|
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
this.addAbility(ability, watcher);
|
ability.addCost(new DiscardTargetCost(new TargetCardInHand(filter)).setText("discard the last card you drew this turn"));
|
||||||
|
this.addAbility(ability, new JandorsRingWatcher());
|
||||||
}
|
}
|
||||||
|
|
||||||
private JandorsRing(final JandorsRing card) {
|
private JandorsRing(final JandorsRing card) {
|
||||||
|
|
@ -51,86 +53,42 @@ public final class JandorsRing extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class JandorsRingEffect extends OneShotEffect {
|
enum JandorsRingPredicate implements Predicate<Card> {
|
||||||
|
instance;
|
||||||
JandorsRingEffect() {
|
|
||||||
super(Outcome.Discard);
|
|
||||||
staticText = "Draw a card";
|
|
||||||
}
|
|
||||||
|
|
||||||
private JandorsRingEffect(final JandorsRingEffect effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JandorsRingEffect copy() {
|
public boolean apply(Card input, Game game) {
|
||||||
return new JandorsRingEffect(this);
|
return JandorsRingWatcher.checkCard(input, game);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
JandorsRingWatcher watcher = game.getState().getWatcher(JandorsRingWatcher.class);
|
|
||||||
if (watcher != null) {
|
|
||||||
UUID cardId = watcher.getLastDrewCard(source.getControllerId());
|
|
||||||
Card card = game.getCard(cardId);
|
|
||||||
if (card != null) {
|
|
||||||
FilterCard filter = new FilterCard(card.getName());
|
|
||||||
filter.add(new CardIdPredicate(card.getId()));
|
|
||||||
DiscardCardYouChooseTargetEffect effect = new DiscardCardYouChooseTargetEffect(filter);
|
|
||||||
if (effect.apply(game, source)) {//Conditional was already checked, card should be in hand, but if for some weird reason it fails, the card won't be drawn, although the cost will already be paid
|
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
|
||||||
if(controller != null) {
|
|
||||||
controller.drawCards(1, source, game);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class JandorsRingWatcher extends Watcher {
|
class JandorsRingWatcher extends Watcher {
|
||||||
|
|
||||||
private Map<UUID, UUID> lastDrawnCards = new HashMap<>();
|
private final Set<UUID> set = new HashSet<>();
|
||||||
|
|
||||||
public JandorsRingWatcher() {
|
JandorsRingWatcher() {
|
||||||
super(WatcherScope.GAME);
|
super(WatcherScope.GAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.DREW_CARD) {
|
if (event.getType() == GameEvent.EventType.DREW_CARD) {
|
||||||
lastDrawnCards.putIfAbsent(event.getPlayerId(), event.getTargetId());
|
set.add(event.getTargetId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
super.reset();
|
super.reset();
|
||||||
lastDrawnCards.clear();
|
set.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getLastDrewCard(UUID playerId) {
|
static boolean checkCard(Card card, Game game) {
|
||||||
return lastDrawnCards.get(playerId);
|
return card != null
|
||||||
|
&& game
|
||||||
|
.getState()
|
||||||
|
.getWatcher(JandorsRingWatcher.class)
|
||||||
|
.set
|
||||||
|
.contains(card.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum WatchedCardInHandCondition implements Condition {
|
|
||||||
|
|
||||||
instance;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
JandorsRingWatcher watcher = game.getState().getWatcher(JandorsRingWatcher.class);
|
|
||||||
|
|
||||||
return watcher != null
|
|
||||||
&& game.getPlayer(source.getControllerId()).getHand().contains(watcher.getLastDrewCard(source.getControllerId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "if last drawn card is still in hand";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
|
@ -38,12 +37,11 @@ public class KeeperOfTheMind extends CardImpl {
|
||||||
this.toughness = new MageInt(2);
|
this.toughness = new MageInt(2);
|
||||||
|
|
||||||
// {U}, {tap}: Choose target opponent who had at least two more cards in hand than you did as you activated this ability. Draw a card.
|
// {U}, {tap}: Choose target opponent who had at least two more cards in hand than you did as you activated this ability. Draw a card.
|
||||||
Effect effect = new DrawCardSourceControllerEffect(1);
|
|
||||||
effect.setText("Choose target opponent who had at least two more cards in hand than you did as you activated this ability. Draw a card.");
|
|
||||||
Ability ability = new ConditionalActivatedAbility(
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{U}"), KeeperOfTheMindCondition.instance,
|
Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1)
|
||||||
"{U}, {T}: Choose target opponent who had at least two more cards in "
|
.setText("choose target opponent who has at least two more cards in hand than you do as you activate this ability. Draw a card"),
|
||||||
+ "hand than you did as you activated this ability. Draw a card.");
|
new ManaCostsImpl<>("{U}"), KeeperOfTheMindCondition.instance
|
||||||
|
).hideCondition();
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.setTargetAdjuster(KeeperOfTheMindAdjuster.instance);
|
ability.setTargetAdjuster(KeeperOfTheMindAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ import mage.abilities.effects.common.TransformSourceEffect;
|
||||||
import mage.abilities.keyword.TransformAbility;
|
import mage.abilities.keyword.TransformAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.AbilityWord;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
@ -31,10 +31,8 @@ public final class KindlyStranger extends CardImpl {
|
||||||
// <i>Delirium</i> — {2}{B}: Transform Kindly Stranger. Activate this ability only if there are four or more card types among cards in your graveyard.
|
// <i>Delirium</i> — {2}{B}: Transform Kindly Stranger. Activate this ability only if there are four or more card types among cards in your graveyard.
|
||||||
this.addAbility(new TransformAbility());
|
this.addAbility(new TransformAbility());
|
||||||
this.addAbility(new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
Zone.BATTLEFIELD, new TransformSourceEffect(), new ManaCostsImpl<>("{2}{B}"),
|
new TransformSourceEffect(), new ManaCostsImpl<>("{2}{B}"), DeliriumCondition.instance
|
||||||
DeliriumCondition.instance, "<i>Delirium</i> — {2}{B}: Transform {this}. " +
|
).setAbilityWord(AbilityWord.DELIRIUM).addHint(CardTypesInGraveyardCount.YOU.getHint()));
|
||||||
"Activate only if there are four or more card types among cards in your graveyard."
|
|
||||||
).addHint(CardTypesInGraveyardCount.YOU.getHint()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private KindlyStranger(final KindlyStranger card) {
|
private KindlyStranger(final KindlyStranger card) {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import mage.MageObjectReference;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.DelayedTriggeredAbility;
|
import mage.abilities.DelayedTriggeredAbility;
|
||||||
import mage.abilities.condition.CompoundCondition;
|
import mage.abilities.condition.CompoundCondition;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.InvertCondition;
|
import mage.abilities.condition.InvertCondition;
|
||||||
import mage.abilities.condition.common.DefendingPlayerControlsNoSourceCondition;
|
import mage.abilities.condition.common.DefendingPlayerControlsNoSourceCondition;
|
||||||
import mage.abilities.condition.common.IsPhaseCondition;
|
import mage.abilities.condition.common.IsPhaseCondition;
|
||||||
|
|
@ -36,6 +37,12 @@ public final class KjeldoranGuard extends CardImpl {
|
||||||
filter.add(SuperType.SNOW.getPredicate());
|
filter.add(SuperType.SNOW.getPredicate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Condition condition = new CompoundCondition(
|
||||||
|
"during combat and only if defending player controls no snow lands",
|
||||||
|
new IsPhaseCondition(TurnPhase.COMBAT, false), // Only during combat
|
||||||
|
new InvertCondition(new DefendingPlayerControlsNoSourceCondition(filter)) // Only if defending player controls no snow land
|
||||||
|
);
|
||||||
|
|
||||||
public KjeldoranGuard(UUID ownerId, CardSetInfo setInfo) {
|
public KjeldoranGuard(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
|
||||||
|
|
||||||
|
|
@ -45,19 +52,8 @@ public final class KjeldoranGuard extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// {T}: Target creature gets +1/+1 until end of turn. When that creature leaves the battlefield this turn, sacrifice Kjeldoran Guard. Activate only during combat and only if defending player controls no snow lands.
|
// {T}: Target creature gets +1/+1 until end of turn. When that creature leaves the battlefield this turn, sacrifice Kjeldoran Guard. Activate only during combat and only if defending player controls no snow lands.
|
||||||
CompoundCondition condition = new CompoundCondition(
|
|
||||||
new IsPhaseCondition(TurnPhase.COMBAT, false), // Only during combat
|
|
||||||
new InvertCondition(new DefendingPlayerControlsNoSourceCondition(filter)) // Only if defending player controls no snow land
|
|
||||||
);
|
|
||||||
|
|
||||||
Ability ability = new ConditionalActivatedAbility(
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
Zone.BATTLEFIELD,
|
new KjeldoranGuardEffect(), new TapSourceCost(), condition
|
||||||
new KjeldoranGuardEffect(),
|
|
||||||
new TapSourceCost(),
|
|
||||||
condition,
|
|
||||||
"{T}: Target creature gets +1/+1 until end of turn. "
|
|
||||||
+ "When that creature leaves the battlefield this turn, sacrifice {this}. "
|
|
||||||
+ "Activate only during combat and only if defending player controls no snow lands."
|
|
||||||
);
|
);
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
@ -77,7 +73,7 @@ class KjeldoranGuardEffect extends OneShotEffect {
|
||||||
|
|
||||||
KjeldoranGuardEffect() {
|
KjeldoranGuardEffect() {
|
||||||
super(Outcome.BoostCreature);
|
super(Outcome.BoostCreature);
|
||||||
staticText = "Target creature gets +1/+1 until end of turn. "
|
staticText = "target creature gets +1/+1 until end of turn. "
|
||||||
+ "When that creature leaves the battlefield this turn, sacrifice {this}.";
|
+ "When that creature leaves the battlefield this turn, sacrifice {this}.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,7 +105,7 @@ class KjeldoranGuardEffect extends OneShotEffect {
|
||||||
|
|
||||||
// Locking in the Kjeldoran Guard (and its zcc), to be sacrificed later.
|
// Locking in the Kjeldoran Guard (and its zcc), to be sacrificed later.
|
||||||
Permanent guard = source.getSourcePermanentIfItStillExists(game);
|
Permanent guard = source.getSourcePermanentIfItStillExists(game);
|
||||||
if(guard != null) {
|
if (guard != null) {
|
||||||
delayed.getEffects().setTargetPointer(new FixedTarget(guard, game));
|
delayed.getEffects().setTargetPointer(new FixedTarget(guard, game));
|
||||||
}
|
}
|
||||||
game.addDelayedTriggeredAbility(delayed, source);
|
game.addDelayedTriggeredAbility(delayed, source);
|
||||||
|
|
@ -152,4 +148,4 @@ class KjeldoranGuardDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "When that creature leaves the battlefield, Sacrifice {this}";
|
return "When that creature leaves the battlefield, Sacrifice {this}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package mage.cards.l;
|
package mage.cards.l;
|
||||||
|
|
||||||
import java.util.UUID;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.CardsInHandCondition;
|
import mage.abilities.condition.common.CardsInHandCondition;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
|
|
@ -11,25 +10,26 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.ComparisonType;
|
import mage.constants.ComparisonType;
|
||||||
import mage.constants.Zone;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class LibraryOfAlexandria extends CardImpl {
|
public final class LibraryOfAlexandria extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new CardsInHandCondition(ComparisonType.EQUAL_TO, 7);
|
||||||
|
|
||||||
public LibraryOfAlexandria(UUID ownerId, CardSetInfo setInfo) {
|
public LibraryOfAlexandria(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||||
|
|
||||||
// {tap}: Add {C}.
|
// {tap}: Add {C}.
|
||||||
this.addAbility(new ColorlessManaAbility());
|
this.addAbility(new ColorlessManaAbility());
|
||||||
|
|
||||||
// {tap}: Draw a card. Activate this ability only if you have exactly seven cards in hand.
|
// {tap}: Draw a card. Activate this ability only if you have exactly seven cards in hand.
|
||||||
this.addAbility(new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
Zone.BATTLEFIELD,
|
new DrawCardSourceControllerEffect(1), new TapSourceCost(), condition
|
||||||
new DrawCardSourceControllerEffect(1),
|
));
|
||||||
new TapSourceCost(),
|
|
||||||
new CardsInHandCondition(ComparisonType.EQUAL_TO, 7),
|
|
||||||
""));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private LibraryOfAlexandria(final LibraryOfAlexandria card) {
|
private LibraryOfAlexandria(final LibraryOfAlexandria card) {
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.PhaseStep;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
|
@ -33,16 +31,15 @@ public final class LifeMatrix extends CardImpl {
|
||||||
// “Remove a matrix counter from this creature: Regenerate this creature.”
|
// “Remove a matrix counter from this creature: Regenerate this creature.”
|
||||||
// Activate this ability only during your upkeep.
|
// Activate this ability only during your upkeep.
|
||||||
Ability ability = new ConditionalActivatedAbility(
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
Zone.BATTLEFIELD,
|
|
||||||
new AddCountersTargetEffect(CounterType.MATRIX.createInstance()),
|
new AddCountersTargetEffect(CounterType.MATRIX.createInstance()),
|
||||||
new GenericManaCost(4),
|
new GenericManaCost(4), IsStepCondition.getMyUpkeep()
|
||||||
new IsStepCondition(PhaseStep.UPKEEP), "{4}, {T}: Put a matrix counter on target creature and "
|
);
|
||||||
+ "that creature gains \"Remove a matrix counter from this creature: "
|
ability.addEffect(new GainAbilityTargetEffect(
|
||||||
+ "Regenerate this creature.\" Activate only during your upkeep.");
|
new SimpleActivatedAbility(
|
||||||
Ability ability2 = new SimpleActivatedAbility(
|
new RegenerateSourceEffect(),
|
||||||
new RegenerateSourceEffect(),
|
new RemoveCountersSourceCost(CounterType.MATRIX.createInstance())
|
||||||
new RemoveCountersSourceCost(CounterType.MATRIX.createInstance()));
|
), Duration.Custom
|
||||||
ability.addEffect(new GainAbilityTargetEffect(ability2, Duration.Custom));
|
).setText("and that creature gains \"Remove a matrix counter from this creature: Regenerate this creature.\""));
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObjectReference;
|
import mage.MageObjectReference;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.InvertCondition;
|
import mage.abilities.condition.InvertCondition;
|
||||||
|
import mage.abilities.condition.common.OpponentsTurnCondition;
|
||||||
import mage.abilities.condition.common.TargetAttackedThisTurnCondition;
|
import mage.abilities.condition.common.TargetAttackedThisTurnCondition;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
|
|
@ -26,18 +23,20 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
import mage.watchers.common.AttackedThisTurnWatcher;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author L_J
|
* @author L_J
|
||||||
*/
|
*/
|
||||||
public final class MaddeningImp extends CardImpl {
|
public final class MaddeningImp extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creatures");
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creatures the active player controls");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(Predicates.not(SubType.WALL.getPredicate()));
|
filter.add(Predicates.not(SubType.WALL.getPredicate()));
|
||||||
filter.add(TargetController.ACTIVE.getControllerPredicate());
|
filter.add(TargetController.ACTIVE.getControllerPredicate());
|
||||||
filter.setMessage("non-Wall creatures the active player controls");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaddeningImp(UUID ownerId, CardSetInfo setInfo) {
|
public MaddeningImp(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
|
@ -50,14 +49,12 @@ public final class MaddeningImp extends CardImpl {
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// {T}: Non-Wall creatures the active player controls attack this turn if able. At the beginning of the next end step, destroy each of those creatures that didn't attack this turn. Activate this ability only during an opponent's turn and only before combat.
|
// {T}: Non-Wall creatures the active player controls attack this turn if able. At the beginning of the next end step, destroy each of those creatures that didn't attack this turn. Activate this ability only during an opponent's turn and only before combat.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter, Duration.EndOfTurn),
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new TapSourceCost(), new MaddeningImpTurnCondition(),
|
new AttacksIfAbleAllEffect(filter, Duration.EndOfTurn),
|
||||||
"{T}: Non-Wall creatures the active player controls attack this turn if able. "
|
new TapSourceCost(), MaddeningImpTurnCondition.instance
|
||||||
+ "At the beginning of the next end step, destroy each of those creatures that didn't attack this turn. "
|
);
|
||||||
+ "Activate only during an opponent's turn and only before combat.");
|
|
||||||
ability.addEffect(new MaddeningImpCreateDelayedTriggeredAbilityEffect());
|
ability.addEffect(new MaddeningImpCreateDelayedTriggeredAbilityEffect());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MaddeningImp(final MaddeningImp card) {
|
private MaddeningImp(final MaddeningImp card) {
|
||||||
|
|
@ -70,17 +67,17 @@ public final class MaddeningImp extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MaddeningImpTurnCondition implements Condition {
|
enum MaddeningImpTurnCondition implements Condition {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
return OpponentsTurnCondition.instance.apply(game, source) && !game.getTurn().isDeclareAttackersStepStarted();
|
||||||
return activePlayer != null && activePlayer.hasOpponent(source.getControllerId(), game) && game.getPhase().getStep().getType().getIndex() < 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "";
|
return "during an opponent's turn and only before combat";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -150,7 +147,7 @@ class MaddeningImpDelayedDestroyEffect extends OneShotEffect {
|
||||||
Player player = game.getPlayer(game.getActivePlayerId());
|
Player player = game.getPlayer(game.getActivePlayerId());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(player.getId())) {
|
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(player.getId())) {
|
||||||
|
|
||||||
MageObjectReference mor = new MageObjectReference(permanent, game);
|
MageObjectReference mor = new MageObjectReference(permanent, game);
|
||||||
// Only affect permanents present when the ability resolved
|
// Only affect permanents present when the ability resolved
|
||||||
if (!activeCreatures.contains(mor)) {
|
if (!activeCreatures.contains(mor)) {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.CardsInHandCondition;
|
import mage.abilities.condition.common.CardsInHandCondition;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
|
|
@ -11,18 +10,20 @@ import mage.abilities.mana.ColorlessManaAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.ComparisonType;
|
import mage.constants.ComparisonType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.SubType;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class MagusOfTheLibrary extends CardImpl {
|
public final class MagusOfTheLibrary extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new CardsInHandCondition(ComparisonType.EQUAL_TO, 7);
|
||||||
|
|
||||||
public MagusOfTheLibrary(UUID ownerId, CardSetInfo setInfo) {
|
public MagusOfTheLibrary(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{G}");
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.WIZARD);
|
this.subtype.add(SubType.WIZARD);
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
|
|
@ -30,14 +31,11 @@ public final class MagusOfTheLibrary extends CardImpl {
|
||||||
|
|
||||||
// {tap}: Add {C}.
|
// {tap}: Add {C}.
|
||||||
this.addAbility(new ColorlessManaAbility());
|
this.addAbility(new ColorlessManaAbility());
|
||||||
|
|
||||||
// {tap}: Draw a card. Activate this ability only if you have exactly seven cards in hand.
|
// {tap}: Draw a card. Activate this ability only if you have exactly seven cards in hand.
|
||||||
this.addAbility(new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
Zone.BATTLEFIELD,
|
new DrawCardSourceControllerEffect(1), new TapSourceCost(), condition
|
||||||
new DrawCardSourceControllerEffect(1),
|
));
|
||||||
new TapSourceCost(),
|
|
||||||
new CardsInHandCondition(ComparisonType.EQUAL_TO, 7),
|
|
||||||
""));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MagusOfTheLibrary(final MagusOfTheLibrary card) {
|
private MagusOfTheLibrary(final MagusOfTheLibrary card) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility;
|
import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility;
|
||||||
|
|
@ -11,7 +9,6 @@ import mage.abilities.condition.common.IsStepCondition;
|
||||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.Effect;
|
|
||||||
import mage.abilities.effects.common.DamageTargetEffect;
|
import mage.abilities.effects.common.DamageTargetEffect;
|
||||||
import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect;
|
import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect;
|
||||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||||
|
|
@ -21,17 +18,20 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.ComparisonType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterAttackingCreature;
|
import mage.filter.common.FilterAttackingCreature;
|
||||||
import mage.filter.common.FilterLandPermanent;
|
import mage.filter.common.FilterLandPermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class Marjhan extends CardImpl {
|
public final class Marjhan extends CardImpl {
|
||||||
|
|
@ -52,8 +52,9 @@ public final class Marjhan extends CardImpl {
|
||||||
this.addAbility(new SimpleStaticAbility(new DontUntapInControllersUntapStepSourceEffect()));
|
this.addAbility(new SimpleStaticAbility(new DontUntapInControllersUntapStepSourceEffect()));
|
||||||
|
|
||||||
// {U}{U}, Sacrifice a creature: Untap Marjhan. Activate this ability only during your upkeep.
|
// {U}{U}, Sacrifice a creature: Untap Marjhan. Activate this ability only during your upkeep.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new UntapSourceEffect(), new ManaCostsImpl<>("{U}{U}"), new IsStepCondition(PhaseStep.UPKEEP), null);
|
new UntapSourceEffect(), new ManaCostsImpl<>("{U}{U}"), IsStepCondition.getMyUpkeep()
|
||||||
|
);
|
||||||
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_PERMANENT_CREATURE));
|
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_PERMANENT_CREATURE));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,27 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||||
import mage.abilities.costs.common.ExileSourceCost;
|
import mage.abilities.costs.common.ExileSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.CreateTokenEffect;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
import mage.filter.FilterSpell;
|
import mage.constants.ComparisonType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterControlledArtifactPermanent;
|
import mage.filter.common.FilterControlledArtifactPermanent;
|
||||||
import mage.filter.common.FilterInstantOrSorceryCard;
|
|
||||||
import mage.filter.predicate.Predicates;
|
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.token.MetallurgicSummoningsConstructToken;
|
import mage.game.permanent.token.MetallurgicSummoningsConstructToken;
|
||||||
import mage.game.stack.Spell;
|
import mage.game.stack.Spell;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -28,26 +29,23 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class MetallurgicSummonings extends CardImpl {
|
public final class MetallurgicSummonings extends CardImpl {
|
||||||
|
|
||||||
private static final FilterSpell filter = new FilterSpell("an instant or sorcery spell");
|
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||||
|
new FilterControlledArtifactPermanent("you control six or more artifacts"),
|
||||||
static {
|
ComparisonType.MORE_THAN, 5
|
||||||
filter.add(Predicates.or(
|
);
|
||||||
CardType.INSTANT.getPredicate(),
|
|
||||||
CardType.SORCERY.getPredicate()));
|
|
||||||
}
|
|
||||||
|
|
||||||
public MetallurgicSummonings(UUID ownerId, CardSetInfo setInfo) {
|
public MetallurgicSummonings(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
|
||||||
|
|
||||||
// Whenever you cast an instant or sorcery spell, create an X/X colorless Construct artifact creature token, where X is that spell's converted mana cost.
|
// Whenever you cast an instant or sorcery spell, create an X/X colorless Construct artifact creature token, where X is that spell's converted mana cost.
|
||||||
this.addAbility(new SpellCastControllerTriggeredAbility(new MetallurgicSummoningsTokenEffect(), filter, false, SetTargetPointer.SPELL));
|
this.addAbility(new SpellCastControllerTriggeredAbility(
|
||||||
|
new MetallurgicSummoningsTokenEffect(), StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false
|
||||||
|
));
|
||||||
|
|
||||||
// {3}{U}{U}, Exile Metallurgic Summons: Return all instant and sorcery cards from your graveyard to your hand. Activate this ability only if you control six or more artifacts.
|
// {3}{U}{U}, Exile Metallurgic Summons: Return all instant and sorcery cards from your graveyard to your hand. Activate this ability only if you control six or more artifacts.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new MetallurgicSummoningsReturnEffect(), new ManaCostsImpl<>("{3}{U}{U}"),
|
new MetallurgicSummoningsReturnEffect(), new ManaCostsImpl<>("{3}{U}{U}"), condition
|
||||||
new PermanentsOnTheBattlefieldCondition(new FilterControlledArtifactPermanent(), ComparisonType.MORE_THAN, 5),
|
);
|
||||||
"{3}{U}{U}, Exile {this}: Return all instant and sorcery cards from your graveyard to your hand."
|
|
||||||
+ " Activate only if you control six or more artifacts.");
|
|
||||||
ability.addCost(new ExileSourceCost());
|
ability.addCost(new ExileSourceCost());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
@ -75,15 +73,11 @@ class MetallurgicSummoningsTokenEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Spell spell = game.getSpellOrLKIStack(this.getTargetPointer().getFirst(game, source));
|
int mv = Optional
|
||||||
if (spell != null) {
|
.ofNullable((Spell) getValue("spellCast"))
|
||||||
int cmc = spell.getManaValue();
|
.map(Spell::getManaValue)
|
||||||
if (cmc > 0) {
|
.orElse(0);
|
||||||
return new CreateTokenEffect(new MetallurgicSummoningsConstructToken(cmc)).apply(game, source);
|
return new MetallurgicSummoningsConstructToken(mv).putOntoBattlefield(1, game, source);
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -96,7 +90,7 @@ class MetallurgicSummoningsReturnEffect extends OneShotEffect {
|
||||||
|
|
||||||
MetallurgicSummoningsReturnEffect() {
|
MetallurgicSummoningsReturnEffect() {
|
||||||
super(Outcome.PutCardInPlay);
|
super(Outcome.PutCardInPlay);
|
||||||
this.staticText = "Return all instant and sorcery cards from your graveyard to your hand. Activate only if you control six or more artifacts";
|
this.staticText = "return all instant and sorcery cards from your graveyard to your hand";
|
||||||
}
|
}
|
||||||
|
|
||||||
private MetallurgicSummoningsReturnEffect(final MetallurgicSummoningsReturnEffect effect) {
|
private MetallurgicSummoningsReturnEffect(final MetallurgicSummoningsReturnEffect effect) {
|
||||||
|
|
@ -111,10 +105,11 @@ class MetallurgicSummoningsReturnEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
return controller != null && controller.moveCards(
|
||||||
return controller.moveCards(controller.getGraveyard().getCards(new FilterInstantOrSorceryCard(),
|
controller.getGraveyard().getCards(
|
||||||
source.getControllerId(), source, game), Zone.HAND, source, game);
|
StaticFilters.FILTER_CARDS_INSTANT_AND_SORCERY,
|
||||||
}
|
source.getControllerId(), source, game
|
||||||
return false;
|
), Zone.HAND, source, game
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
|
|
@ -12,14 +10,13 @@ import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffec
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.PhaseStep;
|
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Quercitron
|
* @author Quercitron
|
||||||
*/
|
*/
|
||||||
public final class Necrosavant extends CardImpl {
|
public final class Necrosavant extends CardImpl {
|
||||||
|
|
@ -33,11 +30,10 @@ public final class Necrosavant extends CardImpl {
|
||||||
this.toughness = new MageInt(5);
|
this.toughness = new MageInt(5);
|
||||||
|
|
||||||
// {3}{B}{B}, Sacrifice a creature: Return Necrosavant from your graveyard to the battlefield. Activate this ability only during your upkeep.
|
// {3}{B}{B}, Sacrifice a creature: Return Necrosavant from your graveyard to the battlefield. Activate this ability only during your upkeep.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.GRAVEYARD,
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new ReturnSourceFromGraveyardToBattlefieldEffect(false,false),
|
Zone.GRAVEYARD,
|
||||||
new ManaCostsImpl<>("{3}{B}{B}"),
|
new ReturnSourceFromGraveyardToBattlefieldEffect(false, false),
|
||||||
new IsStepCondition(PhaseStep.UPKEEP),
|
new ManaCostsImpl<>("{3}{B}{B}"), IsStepCondition.getMyUpkeep()
|
||||||
null
|
|
||||||
);
|
);
|
||||||
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_PERMANENT_CREATURE));
|
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_PERMANENT_CREATURE));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.InvertCondition;
|
import mage.abilities.condition.InvertCondition;
|
||||||
|
import mage.abilities.condition.common.OpponentsTurnCondition;
|
||||||
import mage.abilities.condition.common.TargetAttackedThisTurnCondition;
|
import mage.abilities.condition.common.TargetAttackedThisTurnCondition;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
|
|
@ -19,24 +19,22 @@ import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.permanent.ControlledFromStartOfControllerTurnPredicate;
|
import mage.filter.predicate.permanent.ControlledFromStartOfControllerTurnPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author MTGfan
|
* @author MTGfan
|
||||||
*/
|
*/
|
||||||
public final class NettlingImp extends CardImpl {
|
public final class NettlingImp extends CardImpl {
|
||||||
|
|
||||||
static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall");
|
static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Wall creature the active player has controlled continuously since the beginning of the turn");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(Predicates.not(SubType.WALL.getPredicate()));
|
filter.add(Predicates.not(SubType.WALL.getPredicate()));
|
||||||
filter.add(new ControlledFromStartOfControllerTurnPredicate());
|
filter.add(new ControlledFromStartOfControllerTurnPredicate());
|
||||||
filter.add(TargetController.ACTIVE.getControllerPredicate());
|
filter.add(TargetController.ACTIVE.getControllerPredicate());
|
||||||
filter.setMessage("non-Wall creature the active player has controlled continuously since the beginning of the turn.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public NettlingImp(UUID ownerId, CardSetInfo setInfo) {
|
public NettlingImp(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
|
@ -47,11 +45,12 @@ public final class NettlingImp extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// {T}: Choose target non-Wall creature the active player has controlled continuously since the beginning of the turn. That creature attacks this turn if able. If it doesn't, destroy it at the beginning of the next end step. Activate this ability only during an opponent's turn, before attackers are declared.
|
// {T}: Choose target non-Wall creature the active player has controlled continuously since the beginning of the turn. That creature attacks this turn if able. If it doesn't, destroy it at the beginning of the next end step. Activate this ability only during an opponent's turn, before attackers are declared.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new AttacksIfAbleTargetEffect(Duration.EndOfTurn),
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new TapSourceCost(), new NettlingImpTurnCondition(),
|
new AttacksIfAbleTargetEffect(Duration.EndOfTurn)
|
||||||
"{T}: Choose target non-Wall creature the active player has controlled continuously since the beginning of the turn. "
|
.setText("choose target non-Wall creature the active player has controlled " +
|
||||||
+ "That creature attacks this turn if able. If it doesn't, destroy it at the beginning of the next end step. "
|
"continuously since the beginning of the turn. That creature attacks this turn if able"),
|
||||||
+ "Activate only during an opponent's turn, before attackers are declared.");
|
new TapSourceCost(), NettlingImpTurnCondition.instance
|
||||||
|
);
|
||||||
ability.addEffect(new NettlingImpDelayedDestroyEffect());
|
ability.addEffect(new NettlingImpDelayedDestroyEffect());
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
@ -68,17 +67,17 @@ public final class NettlingImp extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class NettlingImpTurnCondition implements Condition {
|
enum NettlingImpTurnCondition implements Condition {
|
||||||
|
instance;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
return OpponentsTurnCondition.instance.apply(game, source) && !game.getTurn().isDeclareAttackersStepStarted();
|
||||||
return activePlayer != null && activePlayer.hasOpponent(source.getControllerId(), game) && game.getPhase().getStep().getType().getIndex() < 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "";
|
return "during an opponent's turn, before attackers are declared";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -86,7 +85,7 @@ class NettlingImpDelayedDestroyEffect extends OneShotEffect {
|
||||||
|
|
||||||
NettlingImpDelayedDestroyEffect() {
|
NettlingImpDelayedDestroyEffect() {
|
||||||
super(Outcome.Detriment);
|
super(Outcome.Detriment);
|
||||||
this.staticText = "If it doesn't, destroy it at the beginning of the next end step";
|
this.staticText = "Destroy it at the beginning of the next end step if it didn't attack this turn";
|
||||||
}
|
}
|
||||||
|
|
||||||
private NettlingImpDelayedDestroyEffect(final NettlingImpDelayedDestroyEffect effect) {
|
private NettlingImpDelayedDestroyEffect(final NettlingImpDelayedDestroyEffect effect) {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||||
import mage.abilities.hint.common.ArtifactYouControlHint;
|
import mage.abilities.hint.common.ArtifactYouControlHint;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -37,10 +40,9 @@ public final class NimDevourer extends CardImpl {
|
||||||
);
|
);
|
||||||
|
|
||||||
// {B}{B}: Return Nim Devourer from your graveyard to the battlefield, then sacrifice a creature. Activate this ability only during your upkeep.
|
// {B}{B}: Return Nim Devourer from your graveyard to the battlefield, then sacrifice a creature. Activate this ability only during your upkeep.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.GRAVEYARD,
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new ReturnSourceFromGraveyardToBattlefieldEffect(false, false),
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(false, false),
|
||||||
new ManaCostsImpl<>("{B}{B}"),
|
new ManaCostsImpl<>("{B}{B}"), IsStepCondition.getMyUpkeep());
|
||||||
new IsStepCondition(PhaseStep.UPKEEP), null);
|
|
||||||
ability.addEffect(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_A_CREATURE, 1, ", then"));
|
ability.addEffect(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_A_CREATURE, 1, ", then"));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package mage.cards.n;
|
package mage.cards.n;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
|
@ -26,8 +25,9 @@ import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author MTGfan & L_J
|
* @author MTGfan & L_J
|
||||||
*/
|
*/
|
||||||
public final class Norritt extends CardImpl {
|
public final class Norritt extends CardImpl {
|
||||||
|
|
@ -38,13 +38,12 @@ public final class Norritt extends CardImpl {
|
||||||
filterBlue.add(new ColorPredicate(ObjectColor.BLUE));
|
filterBlue.add(new ColorPredicate(ObjectColor.BLUE));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("non-Wall creature");
|
private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("non-Wall creature the active player has controlled continuously since the beginning of the turn");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filterCreature.add(Predicates.not(SubType.WALL.getPredicate()));
|
filterCreature.add(Predicates.not(SubType.WALL.getPredicate()));
|
||||||
filterCreature.add(new ControlledFromStartOfControllerTurnPredicate());
|
filterCreature.add(new ControlledFromStartOfControllerTurnPredicate());
|
||||||
filterCreature.add(TargetController.ACTIVE.getControllerPredicate());
|
filterCreature.add(TargetController.ACTIVE.getControllerPredicate());
|
||||||
filterCreature.setMessage("non-Wall creature the active player has controlled continuously since the beginning of the turn.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Norritt(UUID ownerId, CardSetInfo setInfo) {
|
public Norritt(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
|
@ -60,11 +59,12 @@ public final class Norritt extends CardImpl {
|
||||||
this.addAbility(ability1);
|
this.addAbility(ability1);
|
||||||
|
|
||||||
// {T}: Choose target non-Wall creature the active player has controlled continuously since the beginning of the turn. That creature attacks this turn if able. If it doesn't, destroy it at the beginning of the next end step. Activate this ability only before attackers are declared.
|
// {T}: Choose target non-Wall creature the active player has controlled continuously since the beginning of the turn. That creature attacks this turn if able. If it doesn't, destroy it at the beginning of the next end step. Activate this ability only before attackers are declared.
|
||||||
Ability ability2 = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new AttacksIfAbleTargetEffect(Duration.EndOfTurn),
|
Ability ability2 = new ConditionalActivatedAbility(
|
||||||
new TapSourceCost(), BeforeAttackersAreDeclaredCondition.instance,
|
new AttacksIfAbleTargetEffect(Duration.EndOfTurn)
|
||||||
"{T}: Choose target non-Wall creature the active player has controlled continuously since the beginning of the turn. "
|
.setText("choose target non-Wall creature the active player has controlled continuously " +
|
||||||
+ "That creature attacks this turn if able. Destroy it at the beginning of the next end step if it didn't attack this turn. "
|
"since the beginning of the turn. That creature attacks this turn if able"),
|
||||||
+ "Activate only before attackers are declared.");
|
new TapSourceCost(), BeforeAttackersAreDeclaredCondition.instance
|
||||||
|
);
|
||||||
ability2.addEffect(new NorrittDelayedDestroyEffect());
|
ability2.addEffect(new NorrittDelayedDestroyEffect());
|
||||||
ability2.addTarget(new TargetCreaturePermanent(filterCreature));
|
ability2.addTarget(new TargetCreaturePermanent(filterCreature));
|
||||||
this.addAbility(ability2);
|
this.addAbility(ability2);
|
||||||
|
|
@ -85,7 +85,7 @@ class NorrittDelayedDestroyEffect extends OneShotEffect {
|
||||||
|
|
||||||
NorrittDelayedDestroyEffect() {
|
NorrittDelayedDestroyEffect() {
|
||||||
super(Outcome.Detriment);
|
super(Outcome.Detriment);
|
||||||
this.staticText = "If it doesn't, destroy it at the beginning of the next end step";
|
this.staticText = "Destroy it at the beginning of the next end step if it didn't attack this turn";
|
||||||
}
|
}
|
||||||
|
|
||||||
private NorrittDelayedDestroyEffect(final NorrittDelayedDestroyEffect effect) {
|
private NorrittDelayedDestroyEffect(final NorrittDelayedDestroyEffect effect) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
package mage.cards.r;
|
package mage.cards.r;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.condition.common.DeliriumCondition;
|
import mage.abilities.condition.common.DeliriumCondition;
|
||||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||||
|
|
@ -11,13 +9,14 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.AbilityWord;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
|
||||||
|
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
|
|
@ -34,13 +33,10 @@ public final class ReaperOfFlightMoonsilver extends CardImpl {
|
||||||
|
|
||||||
// <i>Delirium</i> — Sacrifice another creature: Reaper of Flight Moonsilver gets +2/+1 until end of turn.
|
// <i>Delirium</i> — Sacrifice another creature: Reaper of Flight Moonsilver gets +2/+1 until end of turn.
|
||||||
// Activate this ability only if there are four or more card types among cards in your graveyard.
|
// Activate this ability only if there are four or more card types among cards in your graveyard.
|
||||||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
new BoostSourceEffect(2, 1, Duration.EndOfTurn),
|
new BoostSourceEffect(2, 1, Duration.EndOfTurn),
|
||||||
new SacrificeTargetCost(StaticFilters.FILTER_PERMANENT_CREATURE),
|
new SacrificeTargetCost(StaticFilters.FILTER_ANOTHER_CREATURE), DeliriumCondition.instance
|
||||||
DeliriumCondition.instance,
|
).setAbilityWord(AbilityWord.DELIRIUM).addHint(CardTypesInGraveyardCount.YOU.getHint()));
|
||||||
"<i>Delirium</i> — Sacrifice another creature: Reaper of Flight Moonsilver gets +2/+1 until end of turn. "
|
|
||||||
+ "Activate only if there are four or more card types among cards in your graveyard.")
|
|
||||||
.addHint(CardTypesInGraveyardCount.YOU.getHint()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ReaperOfFlightMoonsilver(final ReaperOfFlightMoonsilver card) {
|
private ReaperOfFlightMoonsilver(final ReaperOfFlightMoonsilver card) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package mage.cards.r;
|
package mage.cards.r;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldAbility;
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
|
|
@ -16,36 +15,43 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author anonymous
|
* @author anonymous
|
||||||
*/
|
*/
|
||||||
public final class RockHydra extends CardImpl {
|
public final class RockHydra extends CardImpl {
|
||||||
|
|
||||||
public RockHydra(UUID ownerId, CardSetInfo setInfo) {
|
public RockHydra(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{R}{R}");
|
||||||
|
|
||||||
this.subtype.add(SubType.HYDRA);
|
this.subtype.add(SubType.HYDRA);
|
||||||
this.power = new MageInt(0);
|
this.power = new MageInt(0);
|
||||||
this.toughness = new MageInt(0);
|
this.toughness = new MageInt(0);
|
||||||
|
|
||||||
// Rock Hydra enters the battlefield with X +1/+1 counters on it.
|
// Rock Hydra enters the battlefield with X +1/+1 counters on it.
|
||||||
this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance())));
|
this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance())));
|
||||||
|
|
||||||
// For each 1 damage that would be dealt to Rock Hydra, if it has a +1/+1 counter on it, remove a +1/+1 counter from it and prevent that 1 damage.
|
// For each 1 damage that would be dealt to Rock Hydra, if it has a +1/+1 counter on it, remove a +1/+1 counter from it and prevent that 1 damage.
|
||||||
this.addAbility(new SimpleStaticAbility(new RockHydraEffect()));
|
this.addAbility(new SimpleStaticAbility(new RockHydraEffect()));
|
||||||
|
|
||||||
// {R}: Prevent the next 1 damage that would be dealt to Rock Hydra this turn.
|
// {R}: Prevent the next 1 damage that would be dealt to Rock Hydra this turn.
|
||||||
this.addAbility(new SimpleActivatedAbility(new PreventDamageToSourceEffect(Duration.EndOfTurn, 1), new ManaCostsImpl<>("{R}")));
|
this.addAbility(new SimpleActivatedAbility(
|
||||||
|
new PreventDamageToSourceEffect(Duration.EndOfTurn, 1), new ManaCostsImpl<>("{R}")
|
||||||
|
));
|
||||||
|
|
||||||
// {R}{R}{R}: Put a +1/+1 counter on Rock Hydra. Activate this ability only during your upkeep.
|
// {R}{R}{R}: Put a +1/+1 counter on Rock Hydra. Activate this ability only during your upkeep.
|
||||||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), new ManaCostsImpl<>("{R}{R}{R}"), new IsStepCondition(PhaseStep.UPKEEP), null));
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
|
new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)),
|
||||||
|
new ManaCostsImpl<>("{R}{R}{R}"), IsStepCondition.getMyUpkeep()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private RockHydra(final RockHydra card) {
|
private RockHydra(final RockHydra card) {
|
||||||
|
|
@ -95,5 +101,4 @@ class RockHydraEffect extends PreventionEffectImpl {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,36 @@
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.CardsInHandCondition;
|
import mage.abilities.condition.common.CardsInHandCondition;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.ComparisonType;
|
import mage.constants.ComparisonType;
|
||||||
import mage.constants.Zone;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class ScrollOfOrigins extends CardImpl {
|
public final class ScrollOfOrigins extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new CardsInHandCondition(ComparisonType.MORE_THAN, 6);
|
||||||
|
|
||||||
public ScrollOfOrigins(UUID ownerId, CardSetInfo setInfo) {
|
public ScrollOfOrigins(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||||
|
|
||||||
// {2}, {tap}: Draw a card if you have seven or more cards in hand.
|
// {2}, {tap}: Draw a card if you have seven or more cards in hand.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(2),
|
Ability ability = new SimpleActivatedAbility(new ConditionalOneShotEffect(
|
||||||
new CardsInHandCondition(ComparisonType.MORE_THAN, 6),
|
new DrawCardSourceControllerEffect(1), condition,
|
||||||
"{2}, {T}: Draw a card if you have seven or more cards in hand.");
|
"draw a card if you have seven or more cards in hand"
|
||||||
ability.addCost(new TapSourceCost());
|
), new GenericManaCost(2));
|
||||||
|
ability.addCost(new TapSourceCost());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
|
|
@ -15,18 +13,18 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.PhaseStep;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class ShardPhoenix extends CardImpl {
|
public final class ShardPhoenix extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature without flying");
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature without flying");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
@ -34,20 +32,22 @@ public final class ShardPhoenix extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShardPhoenix(UUID ownerId, CardSetInfo setInfo) {
|
public ShardPhoenix(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}");
|
||||||
this.subtype.add(SubType.PHOENIX);
|
this.subtype.add(SubType.PHOENIX);
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
this.toughness = new MageInt(2);
|
this.toughness = new MageInt(2);
|
||||||
|
|
||||||
// Flying
|
// Flying
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// Sacrifice Shard Phoenix: Shard Phoenix deals 2 damage to each creature without flying.
|
// Sacrifice Shard Phoenix: Shard Phoenix deals 2 damage to each creature without flying.
|
||||||
this.addAbility(new SimpleActivatedAbility(new DamageAllEffect(2, "it", filter), new SacrificeSourceCost()));
|
this.addAbility(new SimpleActivatedAbility(new DamageAllEffect(2, "it", filter), new SacrificeSourceCost()));
|
||||||
|
|
||||||
// {R}{R}{R}: Return Shard Phoenix from your graveyard to your hand. Activate this ability only during your upkeep.
|
// {R}{R}{R}: Return Shard Phoenix from your graveyard to your hand. Activate this ability only during your upkeep.
|
||||||
this.addAbility(new ConditionalActivatedAbility(Zone.GRAVEYARD,
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl<>("{R}{R}{R}"), new IsStepCondition(PhaseStep.UPKEEP), null));
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(),
|
||||||
|
new ManaCostsImpl<>("{R}{R}{R}"), IsStepCondition.getMyUpkeep()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private ShardPhoenix(final ShardPhoenix card) {
|
private ShardPhoenix(final ShardPhoenix card) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.condition.Condition;
|
||||||
|
|
@ -18,14 +16,15 @@ import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.watchers.common.BloodthirstWatcher;
|
import mage.watchers.common.BloodthirstWatcher;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public final class SkarrganFirebird extends CardImpl {
|
public final class SkarrganFirebird extends CardImpl {
|
||||||
|
|
||||||
public SkarrganFirebird(UUID ownerId, CardSetInfo setInfo) {
|
public SkarrganFirebird(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}");
|
||||||
this.subtype.add(SubType.PHOENIX);
|
this.subtype.add(SubType.PHOENIX);
|
||||||
|
|
||||||
this.power = new MageInt(3);
|
this.power = new MageInt(3);
|
||||||
|
|
@ -33,15 +32,15 @@ public final class SkarrganFirebird extends CardImpl {
|
||||||
|
|
||||||
// Bloodthirst 3
|
// Bloodthirst 3
|
||||||
this.addAbility(new BloodthirstAbility(3));
|
this.addAbility(new BloodthirstAbility(3));
|
||||||
|
|
||||||
// Flying
|
// Flying
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// {R}{R}{R}: Return Skarrgan Firebird from your graveyard to your hand. Activate this ability only if an opponent was dealt damage this turn.
|
// {R}{R}{R}: Return Skarrgan Firebird from your graveyard to your hand. Activate this ability only if an opponent was dealt damage this turn.
|
||||||
this.addAbility(new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
Zone.GRAVEYARD,
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(),
|
||||||
new ReturnSourceFromGraveyardToHandEffect(),
|
new ManaCostsImpl<>("{R}{R}{R}"), OpponentWasDealtDamageCondition.instance
|
||||||
new ManaCostsImpl<>("{R}{R}{R}"),
|
));
|
||||||
new OpponentWasDealtDamageCondition(),
|
|
||||||
null));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private SkarrganFirebird(final SkarrganFirebird card) {
|
private SkarrganFirebird(final SkarrganFirebird card) {
|
||||||
|
|
@ -54,10 +53,8 @@ public final class SkarrganFirebird extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OpponentWasDealtDamageCondition implements Condition {
|
enum OpponentWasDealtDamageCondition implements Condition {
|
||||||
|
instance;
|
||||||
public OpponentWasDealtDamageCondition() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
|
|
@ -67,6 +64,6 @@ class OpponentWasDealtDamageCondition implements Condition {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "if an opponent was dealt damage this turn";
|
return "an opponent was dealt damage this turn";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package mage.cards.s;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.SourceHasCounterCondition;
|
import mage.abilities.condition.common.SourceHasCounterCondition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
|
|
@ -23,6 +24,8 @@ import java.util.UUID;
|
||||||
*/
|
*/
|
||||||
public final class SkarrganHellkite extends CardImpl {
|
public final class SkarrganHellkite extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new SourceHasCounterCondition(CounterType.P1P1);
|
||||||
|
|
||||||
public SkarrganHellkite(UUID ownerId, CardSetInfo setInfo) {
|
public SkarrganHellkite(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{R}");
|
||||||
|
|
||||||
|
|
@ -38,10 +41,8 @@ public final class SkarrganHellkite extends CardImpl {
|
||||||
|
|
||||||
// {3}{R}: Skarrgan Hellkite deals 2 damage divided as you choose among one or two targets. Activate this ability only if Skarrgan Hellkite has a +1/+1 counter on it.
|
// {3}{R}: Skarrgan Hellkite deals 2 damage divided as you choose among one or two targets. Activate this ability only if Skarrgan Hellkite has a +1/+1 counter on it.
|
||||||
Ability ability = new ConditionalActivatedAbility(
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
Zone.BATTLEFIELD, new DamageMultiEffect(),
|
Zone.BATTLEFIELD, new DamageMultiEffect(), new ManaCostsImpl<>("{3}{R}"),
|
||||||
new ManaCostsImpl<>("{3}{R}"), new SourceHasCounterCondition(CounterType.P1P1),
|
condition, "activate only if {this} has a +1/+1 counter on it"
|
||||||
"{3}{R}: {this} deals 2 damage divided as you choose among one or two targets. " +
|
|
||||||
"Activate only if {this} has a +1/+1 counter on it."
|
|
||||||
);
|
);
|
||||||
ability.addTarget(new TargetAnyTargetAmount(2));
|
ability.addTarget(new TargetAnyTargetAmount(2));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
|
|
@ -14,7 +14,6 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.filter.FilterSpell;
|
import mage.filter.FilterSpell;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
import mage.filter.common.FilterControlledPermanent;
|
||||||
import mage.game.permanent.token.SliverToken;
|
import mage.game.permanent.token.SliverToken;
|
||||||
|
|
@ -22,36 +21,36 @@ import mage.game.permanent.token.SliverToken;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author emerald000
|
* @author emerald000
|
||||||
*/
|
*/
|
||||||
public final class SliverHive extends CardImpl {
|
public final class SliverHive extends CardImpl {
|
||||||
|
|
||||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Sliver");
|
|
||||||
private static final FilterSpell filterSpell = new FilterSpell("a Sliver spell");
|
private static final FilterSpell filterSpell = new FilterSpell("a Sliver spell");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
}
|
|
||||||
|
|
||||||
static {
|
|
||||||
filter.add(SubType.SLIVER.getPredicate());
|
|
||||||
filterSpell.add(SubType.SLIVER.getPredicate());
|
filterSpell.add(SubType.SLIVER.getPredicate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||||
|
new FilterControlledPermanent(SubType.SLIVER, "you control a Sliver")
|
||||||
|
);
|
||||||
|
|
||||||
public SliverHive(UUID ownerId, CardSetInfo setInfo) {
|
public SliverHive(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
|
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||||
|
|
||||||
// {T}: Add {C}.
|
// {T}: Add {C}.
|
||||||
this.addAbility(new ColorlessManaAbility());
|
this.addAbility(new ColorlessManaAbility());
|
||||||
|
|
||||||
// {T}: Add one mana of any color. Spend this mana only to cast a Sliver spell.
|
// {T}: Add one mana of any color. Spend this mana only to cast a Sliver spell.
|
||||||
this.addAbility(new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new ConditionalSpellManaBuilder(filterSpell), true));
|
this.addAbility(new ConditionalAnyColorManaAbility(
|
||||||
|
new TapSourceCost(), 1, new ConditionalSpellManaBuilder(filterSpell), true
|
||||||
|
));
|
||||||
|
|
||||||
// {5}, {T}: Create a 1/1 colorless Sliver creature token. Activate this ability only if you control a Sliver.
|
// {5}, {T}: Create a 1/1 colorless Sliver creature token. Activate this ability only if you control a Sliver.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SliverToken()), new TapSourceCost(),
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new PermanentsOnTheBattlefieldCondition(filter),
|
new CreateTokenEffect(new SliverToken()), new GenericManaCost(5), condition
|
||||||
"{5}, {T}: Create a 1/1 colorless Sliver creature token. Activate only if you control a Sliver.");
|
);
|
||||||
ability.addCost(new GenericManaCost(5));
|
ability.addCost(new TapSourceCost());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,4 +62,4 @@ public final class SliverHive extends CardImpl {
|
||||||
public SliverHive copy() {
|
public SliverHive copy() {
|
||||||
return new SliverHive(this);
|
return new SliverHive(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
|
|
@ -13,28 +11,30 @@ import mage.abilities.keyword.ShroudAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class SvyelunitePriest extends CardImpl {
|
public final class SvyelunitePriest extends CardImpl {
|
||||||
|
|
||||||
public SvyelunitePriest(UUID ownerId, CardSetInfo setInfo) {
|
public SvyelunitePriest(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
||||||
this.subtype.add(SubType.MERFOLK);
|
this.subtype.add(SubType.MERFOLK);
|
||||||
this.subtype.add(SubType.CLERIC);
|
this.subtype.add(SubType.CLERIC);
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// {U}{U}, {tap}: Target creature gains shroud until end of turn. Activate this ability only during your upkeep.
|
// {U}{U}, {tap}: Target creature gains shroud until end of turn. Activate this ability only during your upkeep.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(ShroudAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl<>("{U}{U}"),
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new IsStepCondition(PhaseStep.UPKEEP), null);
|
new GainAbilityTargetEffect(
|
||||||
|
ShroudAbility.getInstance(), Duration.EndOfTurn
|
||||||
|
), new ManaCostsImpl<>("{U}{U}"), IsStepCondition.getMyUpkeep()
|
||||||
|
);
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.IsPhaseCondition;
|
import mage.abilities.condition.common.IsPhaseCondition;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
|
|
@ -11,17 +11,19 @@ import mage.abilities.keyword.SpaceflightAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.TurnPhase;
|
import mage.constants.TurnPhase;
|
||||||
import mage.constants.Zone;
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Styxo
|
* @author Styxo
|
||||||
*/
|
*/
|
||||||
public final class TIEBomber extends CardImpl {
|
public final class TIEBomber extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new IsPhaseCondition(TurnPhase.COMBAT);
|
||||||
|
|
||||||
public TIEBomber(UUID ownerId, CardSetInfo setInfo) {
|
public TIEBomber(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{B}");
|
||||||
this.subtype.add(SubType.STARSHIP);
|
this.subtype.add(SubType.STARSHIP);
|
||||||
|
|
@ -33,11 +35,9 @@ public final class TIEBomber extends CardImpl {
|
||||||
|
|
||||||
// {1}: TIE Bomber loses Spaceflight until end od turn. Activate this ability only during combat.
|
// {1}: TIE Bomber loses Spaceflight until end od turn. Activate this ability only during combat.
|
||||||
this.addAbility(new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
Zone.BATTLEFIELD,
|
|
||||||
new LoseAbilitySourceEffect(SpaceflightAbility.getInstance(), Duration.EndOfTurn),
|
new LoseAbilitySourceEffect(SpaceflightAbility.getInstance(), Duration.EndOfTurn),
|
||||||
new GenericManaCost(1),
|
new GenericManaCost(1), condition
|
||||||
new IsPhaseCondition(TurnPhase.COMBAT),
|
));
|
||||||
"{1}: {this} loses Spaceflight until end od turn. Activate only during combat."));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private TIEBomber(final TIEBomber card) {
|
private TIEBomber(final TIEBomber card) {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.common.ChooseColorEffect;
|
import mage.abilities.effects.common.ChooseColorEffect;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
|
import mage.abilities.effects.common.InfoEffect;
|
||||||
import mage.abilities.effects.mana.ManaEffect;
|
import mage.abilities.effects.mana.ManaEffect;
|
||||||
import mage.abilities.mana.SimpleManaAbility;
|
import mage.abilities.mana.SimpleManaAbility;
|
||||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||||
|
|
@ -42,13 +43,11 @@ public final class ThroneOfEldraine extends CardImpl {
|
||||||
|
|
||||||
// {3}, {T}: Draw two cards. Spend only mana of the chosen color to activate this ability.
|
// {3}, {T}: Draw two cards. Spend only mana of the chosen color to activate this ability.
|
||||||
Ability ability = new ConditionalActivatedAbility(
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
Zone.BATTLEFIELD,
|
new DrawCardSourceControllerEffect(2), new GenericManaCost(3),
|
||||||
new DrawCardSourceControllerEffect(2),
|
ThroneOfEldraineChosenColorCondition.instance // disable the ability if no color was chosen or cost is actually {0}.
|
||||||
new GenericManaCost(3),
|
).hideCondition();
|
||||||
ThroneOfEldraineChosenColorCondition.instance, // disable the ability if no color was chosen or cost is actually {0}.
|
|
||||||
"{3}, {T}: Draw two cards. Spend only mana of the chosen color to activate this ability."
|
|
||||||
);
|
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
|
ability.addEffect(new InfoEffect("Spend only mana of the chosen color to activate this ability"));
|
||||||
ability.setCostAdjuster(ThroneOfEldraineAdjuster.instance);
|
ability.setCostAdjuster(ThroneOfEldraineAdjuster.instance);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
@ -214,4 +213,4 @@ enum ThroneOfEldraineChosenColorCondition implements Condition {
|
||||||
ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
|
ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
|
||||||
return color != null || source.getManaCostsToPay().getMana().count() == 0;
|
return color != null || source.getManaCostsToPay().getMana().count() == 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
|
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.ActivatedAbilityImpl;
|
import mage.abilities.ActivatedAbilityImpl;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
|
|
@ -10,21 +9,23 @@ import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect;
|
||||||
import mage.abilities.keyword.BandingAbility;
|
import mage.abilities.keyword.BandingAbility;
|
||||||
import mage.abilities.keyword.BandsWithOtherAbility;
|
import mage.abilities.keyword.BandsWithOtherAbility;
|
||||||
import mage.abilities.mana.BlueManaAbility;
|
import mage.abilities.mana.BlueManaAbility;
|
||||||
import mage.constants.SuperType;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
import mage.constants.SuperType;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author L_J
|
* @author L_J
|
||||||
*/
|
*/
|
||||||
public final class Tolaria extends CardImpl {
|
public final class Tolaria extends CardImpl {
|
||||||
|
|
||||||
|
private static final Condition condition = new IsStepCondition(PhaseStep.UPKEEP, false);
|
||||||
|
|
||||||
public Tolaria(UUID ownerId, CardSetInfo setInfo) {
|
public Tolaria(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||||
this.supertype.add(SuperType.LEGENDARY);
|
this.supertype.add(SuperType.LEGENDARY);
|
||||||
|
|
@ -33,10 +34,15 @@ public final class Tolaria extends CardImpl {
|
||||||
this.addAbility(new BlueManaAbility());
|
this.addAbility(new BlueManaAbility());
|
||||||
|
|
||||||
// {T}: Target creature loses banding and all "bands with other" abilities until end of turn. Activate this ability only during any upkeep step.
|
// {T}: Target creature loses banding and all "bands with other" abilities until end of turn. Activate this ability only during any upkeep step.
|
||||||
ActivatedAbilityImpl ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
ActivatedAbilityImpl ability = new ConditionalActivatedAbility(
|
||||||
new LoseAbilityTargetEffect(BandingAbility.getInstance(), Duration.EndOfTurn), new TapSourceCost(), new IsStepCondition(PhaseStep.UPKEEP, false),
|
new LoseAbilityTargetEffect(
|
||||||
"{T}: Target creature loses banding and all \"bands with other\" abilities until end of turn. Activate only during any upkeep step.");
|
BandingAbility.getInstance(), Duration.EndOfTurn
|
||||||
ability.addEffect(new LoseAbilityTargetEffect(new BandsWithOtherAbility(), Duration.EndOfTurn));
|
).setText("target creature loses banding"),
|
||||||
|
new TapSourceCost(), condition
|
||||||
|
);
|
||||||
|
ability.addEffect(new LoseAbilityTargetEffect(
|
||||||
|
new BandsWithOtherAbility(), Duration.EndOfTurn
|
||||||
|
).setText("and all \"bands with other\" abilities until end of turn"));
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,29 @@
|
||||||
|
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
|
||||||
import mage.abilities.condition.CompoundCondition;
|
import mage.abilities.condition.CompoundCondition;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
import mage.abilities.condition.common.OnOpponentsTurnCondition;
|
import mage.abilities.condition.common.OnOpponentsTurnCondition;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
|
||||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||||
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.common.UntapTargetEffect;
|
import mage.abilities.effects.common.UntapTargetEffect;
|
||||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
|
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
import mage.filter.common.FilterLandPermanent;
|
import mage.filter.common.FilterLandPermanent;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author L_J
|
* @author L_J
|
||||||
*/
|
*/
|
||||||
public final class TradeCaravan extends CardImpl {
|
public final class TradeCaravan extends CardImpl {
|
||||||
|
|
@ -35,8 +34,14 @@ public final class TradeCaravan extends CardImpl {
|
||||||
filter.add(SuperType.BASIC.getPredicate());
|
filter.add(SuperType.BASIC.getPredicate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Condition condition = new CompoundCondition(
|
||||||
|
"during an opponent's upkeep",
|
||||||
|
OnOpponentsTurnCondition.instance,
|
||||||
|
new IsStepCondition(PhaseStep.UPKEEP, false)
|
||||||
|
);
|
||||||
|
|
||||||
public TradeCaravan(UUID ownerId, CardSetInfo setInfo) {
|
public TradeCaravan(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
|
||||||
this.subtype.add(SubType.HUMAN);
|
this.subtype.add(SubType.HUMAN);
|
||||||
this.subtype.add(SubType.NOMAD);
|
this.subtype.add(SubType.NOMAD);
|
||||||
this.power = new MageInt(1);
|
this.power = new MageInt(1);
|
||||||
|
|
@ -44,10 +49,11 @@ public final class TradeCaravan extends CardImpl {
|
||||||
|
|
||||||
// At the beginning of your upkeep, put a currency counter on Trade Caravan.
|
// At the beginning of your upkeep, put a currency counter on Trade Caravan.
|
||||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CURRENCY.createInstance())));
|
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CURRENCY.createInstance())));
|
||||||
|
|
||||||
// Remove two currency counters from Trade Caravan: Untap target basic land. Activate this ability only during an opponent's upkeep.
|
// Remove two currency counters from Trade Caravan: Untap target basic land. Activate this ability only during an opponent's upkeep.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new RemoveCountersSourceCost(CounterType.CURRENCY.createInstance(2)),
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new CompoundCondition(OnOpponentsTurnCondition.instance, new IsStepCondition(PhaseStep.UPKEEP, false)),
|
new UntapTargetEffect(), new RemoveCountersSourceCost(CounterType.CURRENCY.createInstance(2)), condition
|
||||||
"Remove two currency counters from {this}: Untap target basic land. Activate only during an opponent's upkeep.");
|
);
|
||||||
ability.addTarget(new TargetPermanent(filter));
|
ability.addTarget(new TargetPermanent(filter));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.u;
|
package mage.cards.u;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.condition.common.IsStepCondition;
|
import mage.abilities.condition.common.IsStepCondition;
|
||||||
|
|
@ -14,30 +12,30 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.PhaseStep;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class UndeadGladiator extends CardImpl {
|
public final class UndeadGladiator extends CardImpl {
|
||||||
|
|
||||||
public UndeadGladiator(UUID ownerId, CardSetInfo setInfo) {
|
public UndeadGladiator(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
|
||||||
this.subtype.add(SubType.ZOMBIE);
|
this.subtype.add(SubType.ZOMBIE);
|
||||||
this.subtype.add(SubType.BARBARIAN);
|
this.subtype.add(SubType.BARBARIAN);
|
||||||
this.power = new MageInt(3);
|
this.power = new MageInt(3);
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// {1}{B}, Discard a card: Return Undead Gladiator from your graveyard to your hand. Activate this ability only during your upkeep.
|
// {1}{B}, Discard a card: Return Undead Gladiator from your graveyard to your hand. Activate this ability only during your upkeep.
|
||||||
Ability ability = new ConditionalActivatedAbility(Zone.GRAVEYARD,
|
Ability ability = new ConditionalActivatedAbility(
|
||||||
new ReturnSourceFromGraveyardToHandEffect(),
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(),
|
||||||
new ManaCostsImpl<>("{1}{B}"),
|
new ManaCostsImpl<>("{1}{B}"), IsStepCondition.getMyUpkeep()
|
||||||
new IsStepCondition(PhaseStep.UPKEEP), null);
|
);
|
||||||
ability.addCost(new DiscardCardCost());
|
ability.addCost(new DiscardCardCost());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// Cycling {1}{B}
|
// Cycling {1}{B}
|
||||||
this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{1}{B}")));
|
this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{1}{B}")));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,29 @@
|
||||||
package mage.cards.v;
|
package mage.cards.v;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||||
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
|
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.abilities.keyword.ReachAbility;
|
import mage.abilities.keyword.ReachAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterControlledPlaneswalkerPermanent;
|
import mage.filter.common.FilterControlledPlaneswalkerPermanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class ViviensJaguar extends CardImpl {
|
public final class ViviensJaguar extends CardImpl {
|
||||||
|
|
||||||
private static final FilterControlledPlaneswalkerPermanent filter
|
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
|
||||||
= new FilterControlledPlaneswalkerPermanent(
|
new FilterControlledPlaneswalkerPermanent(SubType.VIVIEN, "you control a Vivien planeswalker")
|
||||||
SubType.VIVIEN,
|
);
|
||||||
"a Vivien planeswalker"
|
|
||||||
);
|
|
||||||
|
|
||||||
public ViviensJaguar(UUID ownerId, CardSetInfo setInfo) {
|
public ViviensJaguar(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||||
|
|
@ -39,12 +38,8 @@ public final class ViviensJaguar extends CardImpl {
|
||||||
|
|
||||||
// {2}{G}: Return Vivien's Jaguar from your graveyard to your hand. Activate this ability only if you control a Vivien planeswalker.
|
// {2}{G}: Return Vivien's Jaguar from your graveyard to your hand. Activate this ability only if you control a Vivien planeswalker.
|
||||||
this.addAbility(new ConditionalActivatedAbility(
|
this.addAbility(new ConditionalActivatedAbility(
|
||||||
Zone.GRAVEYARD,
|
Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(),
|
||||||
new ReturnSourceFromGraveyardToHandEffect(),
|
new ManaCostsImpl<>("{2}{G}"), condition
|
||||||
new ManaCostsImpl<>("{2}{G}"),
|
|
||||||
new PermanentsOnTheBattlefieldCondition(filter),
|
|
||||||
"{2}{G}: Return {this} from your graveyard to your hand. "
|
|
||||||
+ "Activate only if you control a Vivien planeswalker."
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ public interface ActivatedAbility extends Ability {
|
||||||
*
|
*
|
||||||
* @param mayActivate
|
* @param mayActivate
|
||||||
*/
|
*/
|
||||||
void setMayActivate(TargetController mayActivate);
|
ActivatedAbility setMayActivate(TargetController mayActivate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the minimal possible cost for what the ability can be activated
|
* Returns the minimal possible cost for what the ability can be activated
|
||||||
|
|
|
||||||
|
|
@ -182,8 +182,9 @@ public abstract class ActivatedAbilityImpl extends AbilityImpl implements Activa
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMayActivate(TargetController mayActivate) {
|
public ActivatedAbilityImpl setMayActivate(TargetController mayActivate) {
|
||||||
this.mayActivate = mayActivate;
|
this.mayActivate = mayActivate;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getActivatorId() {
|
public UUID getActivatorId() {
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,17 @@ import mage.constants.PhaseStep;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public class IsStepCondition implements Condition {
|
public class IsStepCondition implements Condition {
|
||||||
|
|
||||||
protected PhaseStep phaseStep;
|
protected PhaseStep phaseStep;
|
||||||
protected boolean onlyDuringYourSteps;
|
protected boolean onlyDuringYourSteps;
|
||||||
|
private static final IsStepCondition myUpkeep = new IsStepCondition(PhaseStep.UPKEEP, true);
|
||||||
|
|
||||||
|
public static IsStepCondition getMyUpkeep() {
|
||||||
|
return myUpkeep;
|
||||||
|
}
|
||||||
|
|
||||||
public IsStepCondition(PhaseStep phaseStep) {
|
public IsStepCondition(PhaseStep phaseStep) {
|
||||||
this(phaseStep, true);
|
this(phaseStep, true);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import mage.constants.EffectType;
|
||||||
import mage.constants.TimingRule;
|
import mage.constants.TimingRule;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author LevelX
|
* @author LevelX
|
||||||
|
|
@ -17,7 +18,7 @@ public class ConditionalActivatedAbility extends ActivatedAbilityImpl {
|
||||||
|
|
||||||
private static final Effects emptyEffects = new Effects();
|
private static final Effects emptyEffects = new Effects();
|
||||||
|
|
||||||
private String ruleText = null;
|
private final String conditionText;
|
||||||
private boolean showCondition = true;
|
private boolean showCondition = true;
|
||||||
|
|
||||||
public ConditionalActivatedAbility(Effect effect, Cost cost, Condition condition) {
|
public ConditionalActivatedAbility(Effect effect, Cost cost, Condition condition) {
|
||||||
|
|
@ -25,18 +26,18 @@ public class ConditionalActivatedAbility extends ActivatedAbilityImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConditionalActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition) {
|
public ConditionalActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition) {
|
||||||
super(zone, effect, cost);
|
this(zone, effect, cost, condition, null);
|
||||||
this.condition = condition;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConditionalActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition, String rule) {
|
public ConditionalActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition, String conditionText) {
|
||||||
this(zone, effect, cost, condition);
|
super(zone, effect, cost);
|
||||||
this.ruleText = rule;
|
this.condition = condition;
|
||||||
|
this.conditionText = conditionText;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ConditionalActivatedAbility(final ConditionalActivatedAbility ability) {
|
protected ConditionalActivatedAbility(final ConditionalActivatedAbility ability) {
|
||||||
super(ability);
|
super(ability);
|
||||||
this.ruleText = ability.ruleText;
|
this.conditionText = ability.conditionText;
|
||||||
this.showCondition = ability.showCondition;
|
this.showCondition = ability.showCondition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -60,8 +61,11 @@ public class ConditionalActivatedAbility extends ActivatedAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
if (ruleText != null && !ruleText.isEmpty()) {
|
if (conditionText != null) {
|
||||||
return ruleText;
|
if (conditionText.isEmpty()) {
|
||||||
|
return super.getRule();
|
||||||
|
}
|
||||||
|
return super.getRule() + ' ' + CardUtil.getTextWithFirstCharUpperCase(conditionText) + '.';
|
||||||
}
|
}
|
||||||
StringBuilder sb = new StringBuilder(super.getRule());
|
StringBuilder sb = new StringBuilder(super.getRule());
|
||||||
if (showCondition) {
|
if (showCondition) {
|
||||||
|
|
|
||||||
|
|
@ -232,6 +232,12 @@ public final class StaticFilters {
|
||||||
FILTER_CARD_INSTANT_AND_SORCERY.setLockedFilter(true);
|
FILTER_CARD_INSTANT_AND_SORCERY.setLockedFilter(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final FilterInstantOrSorceryCard FILTER_CARDS_INSTANT_AND_SORCERY = new FilterInstantOrSorceryCard("instant and sorcery cards");
|
||||||
|
|
||||||
|
static {
|
||||||
|
FILTER_CARDS_INSTANT_AND_SORCERY.setLockedFilter(true);
|
||||||
|
}
|
||||||
|
|
||||||
public static final FilterPermanentCard FILTER_CARD_PERMANENT = new FilterPermanentCard("permanent card");
|
public static final FilterPermanentCard FILTER_CARD_PERMANENT = new FilterPermanentCard("permanent card");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue