mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
refactor: remove OnEventTriggeredAbility
This commit is contained in:
parent
d893d52190
commit
6d3bd7a19f
30 changed files with 229 additions and 339 deletions
|
|
@ -1,24 +1,22 @@
|
|||
|
||||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public final class AjanisMantra extends CardImpl {
|
||||
|
||||
public AjanisMantra(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}");
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new GainLifeEffect(1), true));
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
|
||||
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(1), true));
|
||||
}
|
||||
|
||||
private AjanisMantra(final AjanisMantra card) {
|
||||
|
|
@ -29,5 +27,4 @@ public final class AjanisMantra extends CardImpl {
|
|||
public AjanisMantra copy() {
|
||||
return new AjanisMantra(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,24 @@
|
|||
|
||||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public final class ArcRunner extends CardImpl {
|
||||
|
||||
public ArcRunner(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
this.subtype.add(SubType.OX);
|
||||
|
||||
|
|
@ -28,7 +26,10 @@ public final class ArcRunner extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect()));
|
||||
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.NEXT, new SacrificeSourceEffect(), false
|
||||
));
|
||||
}
|
||||
|
||||
private ArcRunner(final ArcRunner card) {
|
||||
|
|
|
|||
|
|
@ -1,27 +1,26 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersAllEffect;
|
||||
import mage.abilities.keyword.ModularAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jonubuu
|
||||
*/
|
||||
public final class ArcboundOverseer extends CardImpl {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter;
|
||||
private static final FilterPermanent filter;
|
||||
|
||||
static {
|
||||
filter = new FilterControlledCreaturePermanent("creature you control with modular");
|
||||
|
|
@ -29,16 +28,16 @@ public final class ArcboundOverseer extends CardImpl {
|
|||
}
|
||||
|
||||
public ArcboundOverseer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{8}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{8}");
|
||||
this.subtype.add(SubType.GOLEM);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// At the beginning of your upkeep, put a +1/+1 counter on each creature with modular you control.
|
||||
this.addAbility(new OnEventTriggeredAbility(
|
||||
GameEvent.EventType.UPKEEP_STEP_PRE,
|
||||
"beginning of your upkeep",
|
||||
new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter)));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter)
|
||||
));
|
||||
|
||||
// Modular 6
|
||||
this.addAbility(new ModularAbility(this, 6));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ package mage.cards.a;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -13,7 +13,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetSacrifice;
|
||||
|
|
@ -43,8 +42,9 @@ public final class ArchdemonOfGreed extends CardImpl {
|
|||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// At the beginning of your upkeep, sacrifice a Human. If you can't, tap Archdemon of Greed and it deals 9 damage to you.
|
||||
this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new ArchdemonOfGreedEffect(), false));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ArchdemonOfGreedEffect()));
|
||||
}
|
||||
|
||||
private ArchdemonOfGreed(final ArchdemonOfGreed card) {
|
||||
|
|
@ -60,7 +60,7 @@ public final class ArchdemonOfGreed extends CardImpl {
|
|||
|
||||
public ArchdemonOfGreedEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "Sacrifice a Human. If you can't, tap {this} and it deals 9 damage to you.";
|
||||
this.staticText = "sacrifice a Human. If you can't, tap {this} and it deals 9 damage to you.";
|
||||
}
|
||||
|
||||
private ArchdemonOfGreedEffect(final ArchdemonOfGreedEffect effect) {
|
||||
|
|
|
|||
|
|
@ -1,27 +1,25 @@
|
|||
|
||||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public final class BallLightning extends CardImpl {
|
||||
|
||||
public BallLightning(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}{R}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{R}{R}");
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
|
||||
this.power = new MageInt(6);
|
||||
|
|
@ -29,7 +27,9 @@ public final class BallLightning extends CardImpl {
|
|||
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect()));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.NEXT, new SacrificeSourceEffect(), false
|
||||
));
|
||||
}
|
||||
|
||||
private BallLightning(final BallLightning card) {
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.MorphAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class BlisteringFirecat extends CardImpl {
|
||||
|
||||
public BlisteringFirecat(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}{R}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}{R}");
|
||||
this.subtype.add(SubType.ELEMENTAL, SubType.CAT);
|
||||
|
||||
this.power = new MageInt(7);
|
||||
|
|
@ -30,10 +30,15 @@ public final class BlisteringFirecat extends CardImpl {
|
|||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// At the beginning of the end step, sacrifice Blistering Firecat.
|
||||
this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect()));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.NEXT, new SacrificeSourceEffect(), false
|
||||
));
|
||||
|
||||
// Morph {R}{R}
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{R}{R}")));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,36 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class BloodgiftDemon extends CardImpl {
|
||||
|
||||
public BloodgiftDemon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||
this.subtype.add(SubType.DEMON);
|
||||
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// At the beginning of your upkeep, target player draws a card and loses 1 life.
|
||||
Ability ability = new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new DrawCardTargetEffect(1), false);
|
||||
Effect effect = new LoseLifeTargetEffect(1);
|
||||
effect.setText("and loses 1 life");
|
||||
ability.addEffect(effect);
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new DrawCardTargetEffect(1));
|
||||
ability.addEffect(new LoseLifeTargetEffect(1).setText("and loses 1 life"));
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -13,7 +13,6 @@ import mage.constants.Zone;
|
|||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.SharesCreatureTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
|
|
@ -41,7 +40,7 @@ public final class CallToTheKindred extends CardImpl {
|
|||
// At the beginning of your upkeep, you may look at the top five cards of your library.
|
||||
// If you do, you may put a creature card that shares a creature type with enchanted creature from among them onto the battlefield,
|
||||
// then you put the rest of those cards on the bottom of your library in any order.
|
||||
this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CallToTheKindredEffect(), true));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CallToTheKindredEffect(), true));
|
||||
}
|
||||
|
||||
private CallToTheKindred(final CallToTheKindred card) {
|
||||
|
|
|
|||
|
|
@ -1,20 +1,17 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -28,10 +25,9 @@ public final class CitadelOfPain extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
|
||||
|
||||
// At the beginning of each player's end step, Citadel of Pain deals X damage to that player, where X is the number of untapped lands they control.
|
||||
TriggeredAbility triggered = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE,
|
||||
"beginning of the end step", true,
|
||||
new CitadelOfPainEffect());
|
||||
this.addAbility(triggered);
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.EACH_PLAYER, new CitadelOfPainEffect(), false
|
||||
));
|
||||
}
|
||||
|
||||
private CitadelOfPain(final CitadelOfPain card) {
|
||||
|
|
@ -64,16 +60,15 @@ class CitadelOfPainEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(game.getActivePlayerId());
|
||||
if (player != null) {
|
||||
int damage = game.getBattlefield().countAll(filter, game.getActivePlayerId(), game);
|
||||
player.damage(damage, source.getSourceId(), source, game);
|
||||
return true;
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
int damage = game.getBattlefield().count(filter, game.getActivePlayerId(), source, game);
|
||||
return damage > 0 && player.damage(damage, source.getSourceId(), source, game) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CitadelOfPainEffect copy() {
|
||||
return new CitadelOfPainEffect(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.MillCardsControllerEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
@ -15,8 +14,9 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.events.ZoneChangeGroupEvent;
|
||||
import mage.game.permanent.token.InsectToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class CrawlingSensation extends CardImpl {
|
||||
|
|
@ -25,7 +25,7 @@ public final class CrawlingSensation extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
|
||||
|
||||
// At the beginning of your upkeep, you may put the top two cards of your library into your graveyard.
|
||||
this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new MillCardsControllerEffect(2), true));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new MillCardsControllerEffect(2), true));
|
||||
|
||||
// Whenever one or more land cards are put into your graveyard from anywhere for the first time each turn, create a 1/1 green Insect creature token.
|
||||
this.addAbility(new CrawlingSensationTriggeredAbility());
|
||||
|
|
|
|||
|
|
@ -1,31 +1,29 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class CunningLethemancer extends CardImpl {
|
||||
|
||||
public CunningLethemancer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new DiscardEachPlayerEffect()));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DiscardEachPlayerEffect()));
|
||||
}
|
||||
|
||||
private CunningLethemancer(final CunningLethemancer card) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
@ -17,7 +16,6 @@ import mage.filter.FilterCard;
|
|||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
|
@ -27,16 +25,14 @@ import mage.target.targetpointer.FixedTarget;
|
|||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public final class CurseOfMisfortunes extends CardImpl {
|
||||
|
||||
public CurseOfMisfortunes(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{4}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}");
|
||||
this.subtype.add(SubType.AURA, SubType.CURSE);
|
||||
|
||||
|
||||
// Enchant player
|
||||
TargetPlayer auraTarget = new TargetPlayer();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
|
|
@ -44,7 +40,7 @@ public final class CurseOfMisfortunes extends CardImpl {
|
|||
this.addAbility(new EnchantAbility(auraTarget));
|
||||
|
||||
// At the beginning of your upkeep, you may search your library for a Curse card that doesn't have the same name as a Curse attached to enchanted player, put it onto the battlefield attached to that player, then shuffle your library.
|
||||
this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CurseOfMisfortunesEffect(), true));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CurseOfMisfortunesEffect(), true));
|
||||
}
|
||||
|
||||
private CurseOfMisfortunes(final CurseOfMisfortunes card) {
|
||||
|
|
@ -79,7 +75,7 @@ class CurseOfMisfortunesEffect extends OneShotEffect {
|
|||
FilterCard filter = new FilterCard("Curse card that doesn't have the same name as a Curse attached to enchanted player");
|
||||
filter.add(SubType.CURSE.getPredicate());
|
||||
// get the names of attached Curses
|
||||
for (UUID attachmentId: targetPlayer.getAttachments()) {
|
||||
for (UUID attachmentId : targetPlayer.getAttachments()) {
|
||||
Permanent attachment = game.getPermanent(attachmentId);
|
||||
if (attachment != null && attachment.hasSubtype(SubType.CURSE, game)) {
|
||||
filter.add(Predicates.not(new NamePredicate(attachment.getName())));
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.LoseAllAbilitiesAllEffect;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class DressDown extends CardImpl {
|
||||
|
|
@ -32,12 +31,13 @@ public final class DressDown extends CardImpl {
|
|||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)));
|
||||
|
||||
// Creatures lose all abilities.
|
||||
this.addAbility(new SimpleStaticAbility(new LoseAllAbilitiesAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES, Duration.WhileOnBattlefield)));
|
||||
this.addAbility(new SimpleStaticAbility(new LoseAllAbilitiesAllEffect(
|
||||
StaticFilters.FILTER_PERMANENT_CREATURES, Duration.WhileOnBattlefield
|
||||
)));
|
||||
|
||||
// At the beginning of the end step, sacrifice Dress Down.
|
||||
this.addAbility(new OnEventTriggeredAbility(
|
||||
GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step",
|
||||
true, new SacrificeSourceEffect()
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.NEXT, new SacrificeSourceEffect(), false
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,34 +1,34 @@
|
|||
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
*/
|
||||
public final class EndlessRanksOfTheDead extends CardImpl {
|
||||
|
||||
public EndlessRanksOfTheDead(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}");
|
||||
|
||||
// At the beginning of your upkeep, create X 2/2 black Zombie creature tokens,
|
||||
// where X is half the number of Zombies you control, rounded down.
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep",
|
||||
new CreateTokenEffect(new ZombieToken(), new HalfZombiesCount())));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new CreateTokenEffect(new ZombieToken(), HalfZombiesCount.instance)
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -42,23 +42,19 @@ public final class EndlessRanksOfTheDead extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class HalfZombiesCount implements DynamicValue {
|
||||
enum HalfZombiesCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(SubType.ZOMBIE.getPredicate());
|
||||
}
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent(SubType.ZOMBIE);
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int amount = game.getBattlefield().countAll(filter, sourceAbility.getControllerId(), game) / 2;
|
||||
return amount;
|
||||
return game.getBattlefield().count(filter, sourceAbility.getControllerId(), sourceAbility, game) / 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HalfZombiesCount copy() {
|
||||
return new HalfZombiesCount();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,29 +1,27 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.CreateTokenCopyTargetEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
*
|
||||
*/
|
||||
public final class FollowedFootsteps extends CardImpl {
|
||||
|
||||
|
|
@ -35,11 +33,10 @@ public final class FollowedFootsteps extends CardImpl {
|
|||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Copy));
|
||||
Ability ability = new EnchantAbility(auraTarget);
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new EnchantAbility(auraTarget));
|
||||
|
||||
// At the beginning of your upkeep, create a token that's a copy of enchanted creature.
|
||||
this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new FollowedFootstepsEffect(), false));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new FollowedFootstepsEffect()));
|
||||
}
|
||||
|
||||
private FollowedFootsteps(final FollowedFootsteps card) {
|
||||
|
|
|
|||
|
|
@ -1,29 +1,27 @@
|
|||
|
||||
|
||||
package mage.cards.h;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.UnearthAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public final class HellsThunder extends CardImpl {
|
||||
|
||||
public HellsThunder(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
|
||||
this.power = new MageInt(4);
|
||||
|
|
@ -31,9 +29,10 @@ public final class HellsThunder extends CardImpl {
|
|||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect()));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.NEXT, new SacrificeSourceEffect(), false
|
||||
));
|
||||
this.addAbility(new UnearthAbility(new ManaCostsImpl<>("{4}{R}")));
|
||||
|
||||
}
|
||||
|
||||
private HellsThunder(final HellsThunder card) {
|
||||
|
|
|
|||
|
|
@ -1,21 +1,19 @@
|
|||
|
||||
|
||||
package mage.cards.h;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.keyword.UnearthAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -23,7 +21,7 @@ import mage.game.events.GameEvent.EventType;
|
|||
public final class HellsparkElemental extends CardImpl {
|
||||
|
||||
public HellsparkElemental(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
|
||||
this.power = new MageInt(3);
|
||||
|
|
@ -34,7 +32,9 @@ public final class HellsparkElemental extends CardImpl {
|
|||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// At the beginning of the end step, sacrifice Hellspark Elemental.
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect()));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.NEXT, new SacrificeSourceEffect(), false
|
||||
));
|
||||
|
||||
// Unearth {1}{R}: Return this card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)
|
||||
this.addAbility(new UnearthAbility(new ManaCostsImpl<>("{1}{R}")));
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
|
||||
package mage.cards.l;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
*/
|
||||
public final class LightningSerpent extends CardImpl {
|
||||
|
|
@ -31,12 +30,17 @@ public final class LightningSerpent extends CardImpl {
|
|||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// Lightning Serpent enters the battlefield with X +1/+0 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.P1P0.createInstance())));
|
||||
|
||||
// At the beginning of the end step, sacrifice Lightning Serpent.
|
||||
this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect()));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.NEXT, new SacrificeSourceEffect(), false
|
||||
));
|
||||
}
|
||||
|
||||
private LightningSerpent(final LightningSerpent card) {
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@ package mage.cards.l;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -40,9 +40,8 @@ public final class LightningSkelemental extends CardImpl {
|
|||
));
|
||||
|
||||
// At the beginning of the end step, sacrifice Lightning Skelemental.
|
||||
this.addAbility(new OnEventTriggeredAbility(
|
||||
GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step",
|
||||
true, new SacrificeSourceEffect()
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.NEXT, new SacrificeSourceEffect(), false
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,40 +1,52 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
||||
|
||||
/**
|
||||
* @author L_J
|
||||
*/
|
||||
public final class ManaCache extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterLandPermanent("untapped land that player controls");
|
||||
|
||||
static {
|
||||
filter.add(TappedPredicate.UNTAPPED);
|
||||
filter.add(TargetController.ACTIVE.getControllerPredicate());
|
||||
}
|
||||
|
||||
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter);
|
||||
|
||||
public ManaCache(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{R}");
|
||||
|
||||
// At the beginning of each player's end step, put a charge counter on Mana Cache for each untapped land that player controls.
|
||||
TriggeredAbility ability = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of each player's end step", true, new ManaCacheEffect());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.EACH_PLAYER,
|
||||
new AddCountersSourceEffect(CounterType.CHARGE.createInstance(), xValue),
|
||||
false
|
||||
));
|
||||
|
||||
// Remove a charge counter from Mana Cache: Add {C}. Any player may activate this ability but only during their turn before the end step.
|
||||
this.addAbility(new ManaCacheManaAbility());
|
||||
|
|
@ -50,41 +62,6 @@ public final class ManaCache extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class ManaCacheEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledLandPermanent();
|
||||
|
||||
static {
|
||||
filter.add(TappedPredicate.UNTAPPED);
|
||||
}
|
||||
|
||||
public ManaCacheEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "put a charge counter on {this} for each untapped land that player controls";
|
||||
}
|
||||
|
||||
private ManaCacheEffect(final ManaCacheEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ManaCacheEffect copy() {
|
||||
return new ManaCacheEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(game.getActivePlayerId());
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && sourcePermanent != null) {
|
||||
int controlledUntappedLands = game.getBattlefield().countAll(filter, game.getActivePlayerId(), game);
|
||||
sourcePermanent.addCounters(CounterType.CHARGE.createInstance(controlledUntappedLands), source.getControllerId(), source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class ManaCacheManaAbility extends ActivatedManaAbilityImpl {
|
||||
|
||||
public ManaCacheManaAbility() {
|
||||
|
|
|
|||
|
|
@ -2,20 +2,22 @@ package mage.cards.m;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.MultiAmountType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.WolfToken;
|
||||
import mage.players.Player;
|
||||
|
|
@ -39,8 +41,7 @@ public final class MasterOfTheWildHunt extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// At the beginning of your upkeep, create a 2/2 green Wolf creature token.
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep",
|
||||
new CreateTokenEffect(new WolfToken())));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new WolfToken())));
|
||||
|
||||
// {T}: Tap all untapped Wolf creatures you control. Each Wolf tapped this way deals damage equal to its power to target creature. That creature deals damage equal to its power divided as its controller chooses among any number of those Wolves.
|
||||
Ability ability = new SimpleActivatedAbility(new MasterOfTheWildHuntEffect(), new TapSourceCost());
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -28,8 +26,9 @@ public final class Monsoon extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}{G}");
|
||||
|
||||
// At the beginning of each player's end step, tap all untapped Islands that player controls and Monsoon deals X damage to the player, where X is the number of Islands tapped this way.
|
||||
TriggeredAbility ability = new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of each player's end step", true, new MonsoonEffect());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.EACH_PLAYER, new MonsoonEffect(), false
|
||||
));
|
||||
}
|
||||
|
||||
private Monsoon(final Monsoon card) {
|
||||
|
|
|
|||
|
|
@ -1,27 +1,25 @@
|
|||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.OpponentsPoisonCountersCount;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.InfectAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.token.InsectInfectToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class PhyrexianSwarmlord extends CardImpl {
|
||||
|
||||
public PhyrexianSwarmlord(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
|
||||
this.subtype.add(SubType.PHYREXIAN);
|
||||
this.subtype.add(SubType.INSECT);
|
||||
this.subtype.add(SubType.HORROR);
|
||||
|
|
@ -30,8 +28,9 @@ public final class PhyrexianSwarmlord extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
this.addAbility(InfectAbility.getInstance());
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep",
|
||||
new CreateTokenEffect(new InsectInfectToken(), OpponentsPoisonCountersCount.instance)));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new CreateTokenEffect(new InsectInfectToken(), OpponentsPoisonCountersCount.instance)
|
||||
));
|
||||
}
|
||||
|
||||
private PhyrexianSwarmlord(final PhyrexianSwarmlord card) {
|
||||
|
|
@ -43,4 +42,3 @@ public final class PhyrexianSwarmlord extends CardImpl {
|
|||
return new PhyrexianSwarmlord(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,28 +1,26 @@
|
|||
|
||||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.InfectAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
*/
|
||||
public final class Putrefax extends CardImpl {
|
||||
|
||||
public Putrefax (UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}");
|
||||
public Putrefax(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
|
||||
this.subtype.add(SubType.PHYREXIAN);
|
||||
this.subtype.add(SubType.HORROR);
|
||||
|
||||
|
|
@ -31,7 +29,9 @@ public final class Putrefax extends CardImpl {
|
|||
this.addAbility(TrampleAbility.getInstance());
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
this.addAbility(InfectAbility.getInstance());
|
||||
this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect()));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.NEXT, new SacrificeSourceEffect(), false
|
||||
));
|
||||
}
|
||||
|
||||
private Putrefax(final Putrefax card) {
|
||||
|
|
|
|||
|
|
@ -1,31 +1,32 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class RoaringPrimadox extends CardImpl {
|
||||
|
||||
public RoaringPrimadox(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
|
||||
this.subtype.add(SubType.BEAST);
|
||||
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// At the beginning of your upkeep, return a creature you control to its owner's hand.
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new ReturnToHandChosenControlledPermanentEffect(StaticFilters.FILTER_CONTROLLED_CREATURE)));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new ReturnToHandChosenControlledPermanentEffect(StaticFilters.FILTER_CONTROLLED_CREATURE)
|
||||
));
|
||||
}
|
||||
|
||||
private RoaringPrimadox(final RoaringPrimadox card) {
|
||||
|
|
|
|||
|
|
@ -1,31 +1,26 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Quercitron
|
||||
*/
|
||||
public final class Serenity extends CardImpl {
|
||||
|
||||
public Serenity(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
|
||||
|
||||
// At the beginning of your upkeep, destroy all artifacts and enchantments. They can't be regenerated.
|
||||
Effect effect = new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_ARTIFACTS_AND_ENCHANTMENTS, true);
|
||||
Ability ability = new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", effect, false);
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DestroyAllEffect(
|
||||
StaticFilters.FILTER_PERMANENT_ARTIFACTS_AND_ENCHANTMENTS, true
|
||||
)));
|
||||
}
|
||||
|
||||
private Serenity(final Serenity card) {
|
||||
|
|
|
|||
|
|
@ -1,26 +1,25 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class SparkElemental extends CardImpl {
|
||||
|
||||
public SparkElemental(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
|
||||
this.power = new MageInt(3);
|
||||
|
|
@ -28,7 +27,9 @@ public final class SparkElemental extends CardImpl {
|
|||
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new SacrificeSourceEffect()));
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
TargetController.NEXT, new SacrificeSourceEffect(), false
|
||||
));
|
||||
}
|
||||
|
||||
private SparkElemental(final SparkElemental card) {
|
||||
|
|
|
|||
|
|
@ -1,41 +1,43 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
|
||||
import mage.abilities.effects.common.MillCardsControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public final class Splinterfright extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURES);
|
||||
|
||||
public Splinterfright(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Splinterfright's power and toughness are each equal to the number of creature cards in your graveyard.
|
||||
CardsInControllerGraveyardCount count = new CardsInControllerGraveyardCount(new FilterCreatureCard("creature cards"));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(count)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue)));
|
||||
|
||||
// At the beginning of your upkeep, put the top two cards of your library into your graveyard.
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new MillCardsControllerEffect(2), false));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new MillCardsControllerEffect(2)));
|
||||
}
|
||||
|
||||
private Splinterfright(final Splinterfright card) {
|
||||
|
|
|
|||
|
|
@ -1,32 +1,29 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.OnEventTriggeredAbility;
|
||||
import mage.abilities.effects.common.MillCardsControllerEffect;
|
||||
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class TolarianSerpent extends CardImpl {
|
||||
|
||||
public TolarianSerpent(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}");
|
||||
this.subtype.add(SubType.SERPENT);
|
||||
this.power = new MageInt(7);
|
||||
this.toughness = new MageInt(7);
|
||||
|
||||
// At the beginning of your upkeep, put the top seven cards of your library into your graveyard.
|
||||
this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE,
|
||||
"beginning of your upkeep",
|
||||
new MillCardsControllerEffect(7), false));
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new MillCardsControllerEffect(7)));
|
||||
|
||||
}
|
||||
|
||||
private TolarianSerpent(final TolarianSerpent card) {
|
||||
|
|
|
|||
|
|
@ -1,62 +0,0 @@
|
|||
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class OnEventTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private final EventType eventType;
|
||||
private final String eventName;
|
||||
private final boolean allPlayers;
|
||||
|
||||
public OnEventTriggeredAbility(EventType eventType, String eventName, Effect effect) {
|
||||
this(eventType, eventName, effect, false);
|
||||
}
|
||||
|
||||
public OnEventTriggeredAbility(EventType eventType, String eventName, Effect effect, boolean optional) {
|
||||
this(eventType, eventName, false, effect, optional);
|
||||
}
|
||||
|
||||
public OnEventTriggeredAbility(EventType eventType, String eventName, boolean allPlayers, Effect effect) {
|
||||
this(eventType, eventName, allPlayers, effect, false);
|
||||
}
|
||||
|
||||
public OnEventTriggeredAbility(EventType eventType, String eventName, boolean allPlayers, Effect effect, boolean optional) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.eventType = eventType;
|
||||
this.eventName = eventName;
|
||||
this.allPlayers = allPlayers;
|
||||
setTriggerPhrase("At the " + eventName + ", ");
|
||||
}
|
||||
|
||||
protected OnEventTriggeredAbility(final OnEventTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.eventType = ability.eventType;
|
||||
this.eventName = ability.eventName;
|
||||
this.allPlayers = ability.allPlayers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == eventType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return allPlayers || event.getPlayerId().equals(this.controllerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnEventTriggeredAbility copy() {
|
||||
return new OnEventTriggeredAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue