moved Watchers to Ability and moved Counters to CardState

This commit is contained in:
betasteward 2015-03-01 21:17:23 -05:00
parent 620a3b9a52
commit 632573fc3e
204 changed files with 1516 additions and 347 deletions

View file

@ -50,6 +50,7 @@ import mage.target.Targets;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.game.Game;
/**
* @author BetaSteward_at_googlemail.com
@ -116,21 +117,27 @@ public class CardView extends SimpleCardView {
protected boolean canAttack;
public CardView(Card card) {
this(card, null, false);
this(card, null, null, false);
}
public CardView(Card card, UUID cardId) {
this(card, null, false);
this(card, null, null, false);
this.id = cardId;
}
public CardView(Card card, Game game, UUID cardId) {
this(card, game, null, false);
this.id = cardId;
}
/**
*
* @param card
* @param game
* @param cardId
* @param controlled is the card view created for the card controller - used for morph / face down cards to know which player may see information for the card
*/
public CardView(Card card, UUID cardId, boolean controlled) {
public CardView(Card card, Game game, UUID cardId, boolean controlled) {
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt(), card.getTokenSetCode());
this.morphCard = card.isMorphCard();
// no information available for face down cards as long it's not a controlled face down morph card
@ -241,9 +248,9 @@ public class CardView extends SimpleCardView {
this.rarity = card.getRarity();
this.isToken = false;
}
if (card.getCounters() != null && !card.getCounters().isEmpty()) {
if (game != null && card.getCounters(game) != null && !card.getCounters(game).isEmpty()) {
counters = new ArrayList<>();
for (Counter counter: card.getCounters().values()) {
for (Counter counter: card.getCounters(game).values()) {
counters.add(new CounterView(counter));
}
}

View file

@ -136,7 +136,7 @@ public class GameView implements Serializable {
}
else {
// Spell
stack.put(stackObject.getId(), new CardView((Spell)stackObject, null, stackObject.getControllerId().equals(createdForPlayerId)));
stack.put(stackObject.getId(), new CardView((Spell)stackObject, game, null, stackObject.getControllerId().equals(createdForPlayerId)));
checkPaid(stackObject.getId(), (Spell)stackObject);
}
//stackOrder.add(stackObject.getId());

View file

@ -62,7 +62,7 @@ public class PermanentView extends CardView {
private final boolean attachedToPermanent;
public PermanentView(Permanent permanent, Card card, UUID createdForPlayerId, Game game) {
super(permanent, null, permanent.getControllerId().equals(createdForPlayerId));
super(permanent, game, null, permanent.getControllerId().equals(createdForPlayerId));
this.controlled = permanent.getControllerId().equals(createdForPlayerId);
this.rules = permanent.getRules();
this.tapped = permanent.isTapped();

View file

@ -63,8 +63,7 @@ public class MaelstromNexus extends CardImpl {
// The first spell you cast each turn has cascade.
this.addAbility(new MaelstromNexusTriggeredAbility());
this.addWatcher(new FirstSpellCastThisTurnWatcher());
this.addAbility(new MaelstromNexusTriggeredAbility(), new FirstSpellCastThisTurnWatcher());
}

View file

@ -61,8 +61,7 @@ public class PredatoryAdvantage extends CardImpl {
// At the beginning of each opponent's end step, if that player didn't cast a creature spell this turn, put a 2/2 green Lizard creature token onto the battlefield.
this.addWatcher(new CastCreatureWatcher());
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new LizardToken()), TargetController.OPPONENT, new DidNotCastCreatureCondition(), false));
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new LizardToken()), TargetController.OPPONENT, new DidNotCastCreatureCondition(), false), new CastCreatureWatcher());
}
public PredatoryAdvantage(final PredatoryAdvantage card) {

View file

@ -79,8 +79,7 @@ public class UnscytheKillerOfKings extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT)));
// Whenever a creature dealt damage by equipped creature this turn dies, you may exile that card. If you do, put a 2/2 black Zombie creature token onto the battlefield.
this.addAbility(new UnscytheKillerOfKingsTriggeredAbility(new UnscytheEffect()));
this.addWatcher(new EquippedDidDamageWatcher());
this.addAbility(new UnscytheKillerOfKingsTriggeredAbility(new UnscytheEffect()), new EquippedDidDamageWatcher());
// Equip {2}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2), new TargetControlledCreaturePermanent()));

View file

@ -62,7 +62,7 @@ public class Aggravate extends CardImpl {
this.getSpellAbility().addTarget(new TargetPlayer());
// Each creature dealt damage this way attacks this turn if able.
this.getSpellAbility().addEffect(new AggravateRequirementEffect());
this.addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher());
}
public Aggravate(final Aggravate card) {

View file

@ -79,8 +79,7 @@ public class CavernOfSouls extends CardImpl {
this.addAbility(new ColorlessManaAbility());
// {T}: Add one mana of any color to your mana pool. Spend this mana only to cast a creature spell of the chosen type, and that spell can't be countered.
this.addAbility(new ConditionalAnyColorManaAbility(1, new CavernOfSoulsManaBuilder()));
this.addWatcher(new CavernOfSoulsWatcher());
this.addAbility(new ConditionalAnyColorManaAbility(1, new CavernOfSoulsManaBuilder()), new CavernOfSoulsWatcher());
this.addAbility(new SimpleStaticAbility(Zone.ALL, new CavernOfSoulsCantCounterEffect()));
}

View file

@ -62,6 +62,7 @@ public class PillarOfFlame extends CardImpl {
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
// If a creature dealt damage this way would die this turn, exile it instead.
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
this.getSpellAbility().addWatcher(new DamagedByWatcher());
}
public PillarOfFlame(final PillarOfFlame card) {

View file

@ -63,8 +63,7 @@ public class GoblinCohort extends CardImpl {
this.toughness = new MageInt(2);
// Goblin Cohort can't attack unless you've cast a creature spell this turn.
this.addWatcher(new PlayerCastCreatureWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GoblinCohortEffect()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GoblinCohortEffect()), new PlayerCastCreatureWatcher());
}

View file

@ -77,8 +77,8 @@ public class KumanosBlessing extends CardImpl {
this.addAbility(ability);
// If a creature dealt damage by enchanted creature this turn would die, exile it instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KumanosBlessingEffect()));
this.addWatcher(new DamagedByEnchantedWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KumanosBlessingEffect()), new DamagedByEnchantedWatcher());
}
public KumanosBlessing(final KumanosBlessing card) {

View file

@ -78,8 +78,8 @@ public class EpharaGodOfThePolis extends CardImpl {
this.addAbility(new ConditionalTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), TargetController.ANY, false),
HadAnotherCreatureEnterTheBattlefieldCondition.getInstance(),
"At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card."));
this.addWatcher(new CreatureEnteredBattlefieldLastTurnWatcher());
"At the beginning of each upkeep, if you had another creature enter the battlefield under your control last turn, draw a card."),
new CreatureEnteredBattlefieldLastTurnWatcher());
}

View file

@ -60,8 +60,7 @@ public class SpiritOfTheLabyrinth extends CardImpl {
this.toughness = new MageInt(1);
// Each player can't draw more than one card each turn.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpiritOfTheLabyrinthEffect()));
this.addWatcher(new SpiritOfTheLabyrinthWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpiritOfTheLabyrinthEffect()), new SpiritOfTheLabyrinthWatcher());
}

View file

@ -54,8 +54,7 @@ public class AshenSkinZubera extends CardImpl {
this.toughness = new MageInt(2);
Ability ability = new DiesTriggeredAbility(new DiscardTargetEffect(new ZuberasDiedDynamicValue()));
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
this.addWatcher(new ZuberasDiedWatcher());
this.addAbility(ability, new ZuberasDiedWatcher());
}
public AshenSkinZubera(final AshenSkinZubera card) {

View file

@ -75,8 +75,7 @@ public class BoseijuWhoSheltersAll extends CardImpl {
ability.getEffects().get(0).setText("Add {1} to your mana pool. If that mana is spent on an instant or sorcery spell, that spell can't be countered by spells or abilities");
this.addAbility(ability);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoseijuWhoSheltersAllCantCounterEffect()));
this.addWatcher(new BoseijuWhoSheltersAllWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoseijuWhoSheltersAllCantCounterEffect()), new BoseijuWhoSheltersAllWatcher());
}
public BoseijuWhoSheltersAll(final BoseijuWhoSheltersAll card) {

View file

@ -51,8 +51,7 @@ public class DrippingTongueZubera extends CardImpl {
this.color.setGreen(true);
this.power = new MageInt(1);
this.toughness = new MageInt(2);
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SpiritToken(), new ZuberasDiedDynamicValue()), false));
this.addWatcher(new ZuberasDiedWatcher());
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SpiritToken(), new ZuberasDiedDynamicValue()), false), new ZuberasDiedWatcher());
}
public DrippingTongueZubera (final DrippingTongueZubera card) {

View file

@ -55,8 +55,7 @@ public class EmberFistZubera extends CardImpl {
this.toughness = new MageInt(2);
Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(new ZuberasDiedDynamicValue()));
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
this.addWatcher(new ZuberasDiedWatcher());
this.addAbility(ability, new ZuberasDiedWatcher());
}
public EmberFistZubera (final EmberFistZubera card) {

View file

@ -60,8 +60,7 @@ public class FloatingDreamZubera extends CardImpl {
this.color.setBlue(true);
this.power = new MageInt(1);
this.toughness = new MageInt(2);
this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(new ZuberasDiedDynamicValue())));
this.addWatcher(new ZuberasDiedWatcher());
this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(new ZuberasDiedDynamicValue())), new ZuberasDiedWatcher());
}
public FloatingDreamZubera(final FloatingDreamZubera card) {

View file

@ -42,6 +42,7 @@ import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.common.TargetCreatureOrPlayer;
import mage.watchers.common.DamagedByWatcher;
/**
* @author LevelX
@ -62,7 +63,7 @@ public class Frostwielder extends CardImpl {
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
// If a creature dealt damage by Frostwielder this turn would die, exile it instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher());
}

View file

@ -77,9 +77,7 @@ public class HallOfTheBanditLord extends CardImpl {
effect.setText("Add {1} to your mana pool. If that mana is spent on a creature spell, it gains haste");
Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addCost(new PayLifeCost(3));
this.addAbility(ability);
this.addWatcher(new HallOfTheBanditLordWatcher(ability));
this.addAbility(ability, new HallOfTheBanditLordWatcher(ability));
}
public HallOfTheBanditLord(final HallOfTheBanditLord card) {

View file

@ -44,6 +44,7 @@ import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.common.TargetCreatureOrPlayer;
import mage.watchers.common.DamagedByWatcher;
/**
* @author LevelX
@ -65,7 +66,7 @@ public class KumanoMasterYamabushi extends CardImpl {
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
// If a creature dealt damage by Kumano this turn would die, exile it instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher());
}

View file

@ -37,6 +37,7 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.watchers.common.DamagedByWatcher;
/**
* @author LevelX
@ -53,7 +54,7 @@ public class KumanosPupils extends CardImpl {
this.toughness = new MageInt(3);
// If a creature dealt damage by Kumano's Pupils this turn would die, exile it instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DealtDamageToCreatureBySourceDies(this, Duration.WhileOnBattlefield)), new DamagedByWatcher());
}
public KumanosPupils(final KumanosPupils card) {

View file

@ -72,7 +72,7 @@ public class MyojinOfCleansingFire extends CardImpl {
this.power = new MageInt(4);
this.toughness = new MageInt(6);
this.addWatcher(new CastFromHandWatcher());
this.getSpellAbility().addWatcher(new CastFromHandWatcher());
// Myojin of Cleansing Fire enters the battlefield with a divinity counter on it if you cast it from your hand.
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));

View file

@ -68,7 +68,7 @@ public class MyojinOfInfiniteRage extends CardImpl {
this.power = new MageInt(7);
this.toughness = new MageInt(4);
this.addWatcher(new CastFromHandWatcher());
this.getSpellAbility().addWatcher(new CastFromHandWatcher());
// Myojin of Infinite Rage enters the battlefield with a divinity counter on it if you cast it from your hand.
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));

View file

@ -73,7 +73,7 @@ public class MyojinOfLifesWeb extends CardImpl {
this.power = new MageInt(8);
this.toughness = new MageInt(8);
this.addWatcher(new CastFromHandWatcher());
this.getSpellAbility().addWatcher(new CastFromHandWatcher());
// Myojin of Life's Web enters the battlefield with a divinity counter on it if you cast it from your hand.
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));

View file

@ -66,7 +66,7 @@ public class MyojinOfNightsReach extends CardImpl {
this.power = new MageInt(5);
this.toughness = new MageInt(2);
this.addWatcher(new CastFromHandWatcher());
this.getSpellAbility().addWatcher(new CastFromHandWatcher());
// Myojin of Night's Reach enters the battlefield with a divinity counter on it if you cast it from your hand.
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));

View file

@ -71,7 +71,7 @@ public class MyojinOfSeeingWinds extends CardImpl {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
this.addWatcher(new CastFromHandWatcher());
this.getSpellAbility().addWatcher(new CastFromHandWatcher());
// Myojin of Seeing Winds enters the battlefield with a divinity counter on it if you cast it from your hand.
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.DIVINITY.createInstance()), new CastFromHandCondition(), ""), "{this} enters the battlefield with a divinity counter on it if you cast it from your hand"));

View file

@ -74,7 +74,7 @@ public class SiftThroughSands extends CardImpl {
this.getSpellAbility().addEffect(effect);
// If you've cast a spell named Peer Through Depths and a spell named Reach Through Mists this turn, you may search your library for a card named The Unspeakable, put it onto the battlefield, then shuffle your library.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), false, true), new SiftThroughSandsCondition(), rule));
this.addWatcher(new SiftThroughSandsWatcher());
this.getSpellAbility().addWatcher(new SiftThroughSandsWatcher());
}
public SiftThroughSands(final SiftThroughSands card) {

View file

@ -56,8 +56,7 @@ public class SilentChantZubera extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(2);
Ability ability = new DiesTriggeredAbility(new GainLifeEffect(new SilentChantZuberaDynamicValue()));
this.addAbility(ability);
this.addWatcher(new ZuberasDiedWatcher());
this.addAbility(ability, new ZuberasDiedWatcher());
}
public SilentChantZubera (final SilentChantZubera card) {

View file

@ -37,6 +37,7 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.target.common.TargetCreatureOrPlayer;
import mage.watchers.common.DamagedByWatcher;
/**
*
@ -55,6 +56,7 @@ public class YamabushisFlame extends CardImpl {
// If a creature dealt damage this way would die this turn, exile it instead.
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
this.getSpellAbility().addWatcher(new DamagedByWatcher());
}
public YamabushisFlame(final YamabushisFlame card) {

View file

@ -63,6 +63,7 @@ public class YamabushisStorm extends CardImpl {
this.getSpellAbility().addEffect(new DamageAllEffect(1, new FilterCreaturePermanent()));
// If a creature dealt damage this way would die this turn, exile it instead.
this.getSpellAbility().addEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn));
this.getSpellAbility().addWatcher(new DamagedByWatcher());
}
public YamabushisStorm(final YamabushisStorm card) {

View file

@ -75,7 +75,7 @@ public class FuryOfTheHorde extends CardImpl {
// Untap all creatures that attacked this turn. After this main phase, there is an additional combat phase followed by an additional main phase.
this.getSpellAbility().addEffect(new FuryOfTheHordeUntapEffect());
this.getSpellAbility().addEffect(new FuryOfTheHordeAddPhasesEffect());
this.addWatcher(new AttackedThisTurnWatcher());
this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher());
}

View file

@ -100,7 +100,7 @@ class LightningStormCountCondition implements DynamicValue {
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Spell spell = game.getStack().getSpell(sourceAbility.getSourceId());
if (spell != null) {
return spell.getCounters().getCount(counter) + 3;
return spell.getCounters(game).getCount(counter) + 3;
}
return 0;
}

View file

@ -66,8 +66,7 @@ public class CourtHussar extends CardImpl {
new LookLibraryAndPickControllerEffect(new StaticValue(3), false, new StaticValue(1), new FilterCard(), Zone.LIBRARY, false, false),
false));
// When Court Hussar enters the battlefield, sacrifice it unless {W} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.W)), false));
this.addWatcher(new ManaSpentToCastWatcher());
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.W)), false), new ManaSpentToCastWatcher());
}
public CourtHussar(final CourtHussar card) {

View file

@ -82,8 +82,7 @@ public class KaradorGhostChieftain extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.STACK, new KaradorGhostChieftainCostReductionEffect()));
// During each of your turns, you may cast one creature card from your graveyard.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KaradorGhostChieftainContinuousEffect()));
this.addWatcher(new KaradorGhostChieftainWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KaradorGhostChieftainContinuousEffect()), new KaradorGhostChieftainWatcher());
}
public KaradorGhostChieftain(final KaradorGhostChieftain card) {

View file

@ -60,8 +60,7 @@ public class AzoriusHerald extends CardImpl {
// When Azorius Herald enters the battlefield, you gain 4 life.
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4)));
// When Azorius Herald enters the battlefield, sacrifice it unless {U} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.U)), false));
this.addWatcher(new ManaSpentToCastWatcher());
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.U)), false), new ManaSpentToCastWatcher());
}
public AzoriusHerald(final AzoriusHerald card) {

View file

@ -78,8 +78,7 @@ public class FellShepherd extends CardImpl {
this.toughness = new MageInt(6);
// Whenever Fell Shepherd deals combat damage to a player, you may return to your hand all creature cards that were put into your graveyard from the battlefield this turn.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new FellShepherdEffect(), true));
this.addWatcher(new FellShepherdWatcher());
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new FellShepherdEffect(), true), new FellShepherdWatcher());
// {B}, Sacrifice another creature: Target creature gets -2/-2 until end of turn.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2,-2, Duration.EndOfTurn), new ManaCostsImpl("{B}"));

View file

@ -76,8 +76,7 @@ public class JelevaNephaliasScourge extends CardImpl {
// When Jeleva, Nephalia's Scourge enters the battlefield, each player exiles the top X cards of his or her library, where X is the amount of mana spent to cast Jeleva.
this.addAbility(new EntersBattlefieldTriggeredAbility(new JelevaNephaliasScourgeEffect(), false));
// Whenever Jeleva attacks, you may cast an instant or sorcery card exiled with it without paying its mana cost.
this.addAbility(new AttacksTriggeredAbility(new JelevaNephaliasCastEffect(), false));
this.addWatcher(new JelevaNephaliasWatcher());
this.addAbility(new AttacksTriggeredAbility(new JelevaNephaliasCastEffect(), false), new JelevaNephaliasWatcher());
}

View file

@ -75,13 +75,12 @@ public class OpalPalace extends CardImpl {
// {1}, {tap}: Add to your mana pool one mana of any color in your commander's color identity. If you spend this mana to cast your commander, it enters the battlefield with a number of +1/+1 counters on it equal to the number of times it's been cast from the command zone this game.
Ability ability = new CommanderColorIdentityManaAbility(new GenericManaCost(1));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
this.addAbility(ability, new OpalPalaceWatcher());
ability = new SimpleStaticAbility(Zone.ALL, new OpalPalaceEntersBattlefieldEffect());
ability.setRuleVisible(false);
this.addAbility(ability);
this.addWatcher(new OpalPalaceWatcher());
}
public OpalPalace(final OpalPalace card) {

View file

@ -65,8 +65,7 @@ public class AngelOfTheDireHour extends CardImpl {
Ability ability = new EntersBattlefieldTriggeredAbility(
new ConditionalOneShotEffect(new ExileAllEffect(new FilterAttackingCreature("attacking creatures")), new CastFromHandCondition(),
" if you cast it from your hand, exile all attacking creatures"));
this.addAbility(ability);
this.addWatcher(new CastFromHandWatcher());
this.addAbility(ability, new CastFromHandWatcher());
}
public AngelOfTheDireHour(final AngelOfTheDireHour card) {

View file

@ -68,8 +68,7 @@ public class BreachingLeviathan extends CardImpl {
Ability ability = new EntersBattlefieldTriggeredAbility(
new ConditionalOneShotEffect(new BreachingLeviathanEffect(), new CastFromHandCondition(),
"if you cast it from your hand, tap all nonblue creatures. Those creatures don't untap during their controllers' next untap steps"));
this.addAbility(ability);
this.addWatcher(new CastFromHandWatcher());
this.addAbility(ability, new CastFromHandWatcher());
}
public BreachingLeviathan(final BreachingLeviathan card) {

View file

@ -72,8 +72,7 @@ public class ContainmentPriest extends CardImpl {
// Flash
this.addAbility(FlashAbility.getInstance());
// If a nontoken creature would enter the battlefield and it wasn't cast, exile it instead.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ContainmentPriestReplacementEffect()));
this.addWatcher(new CreatureCastWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ContainmentPriestReplacementEffect()), new CreatureCastWatcher());
}
public ContainmentPriest(final ContainmentPriest card) {

View file

@ -62,7 +62,7 @@ public class ImpactResonance extends CardImpl {
effect.setText("{this} deals X damage divided as you choose among any number of target creatures, where X is the greatest amount of damage dealt by a source to a permanent or player this turn");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanentAmount(xValue));
this.addWatcher(new GreatestAmountOfDamageWatcher());
this.getSpellAbility().addWatcher(new GreatestAmountOfDamageWatcher());
}
public ImpactResonance(final ImpactResonance card) {

View file

@ -61,7 +61,7 @@ public class SpoilsOfBlood extends CardImpl {
// Put an X/X black Horror creature token onto the battlefield, where X is the number of creatures that died this turn.
this.getSpellAbility().addEffect(new SpoilsOfBloodEffect());
this.addWatcher(new CreaturesDiedThisTurnWatcher());
this.getSpellAbility().addWatcher(new CreaturesDiedThisTurnWatcher());
}
public SpoilsOfBlood(final SpoilsOfBlood card) {

View file

@ -81,9 +81,8 @@ public class DungeonGeists extends CardImpl {
ability.addEffect(new DungeonGeistsEffect());
Target target = new TargetCreaturePermanent(filter);
ability.addTarget(target);
this.addAbility(ability);
this.addAbility(ability, new DungeonGeistsWatcher());
// watcher needed to send normal events to Dungeon Geists ReplacementEffect
this.addWatcher(new DungeonGeistsWatcher());
}
public DungeonGeists(final DungeonGeists card) {

View file

@ -67,7 +67,7 @@ public class Flamebreak extends CardImpl {
// Flamebreak deals 3 damage to each creature without flying and each player. Creatures dealt damage this way can't be regenerated this turn.
this.getSpellAbility().addEffect(new DamageEverythingEffect(new StaticValue(3), filter1));
this.getSpellAbility().addEffect(new FlamebreakCantRegenerateEffect());
this.addWatcher(new DamagedByWatcher());
this.getSpellAbility().addWatcher(new DamagedByWatcher());
}
public Flamebreak(final Flamebreak card) {

View file

@ -75,8 +75,7 @@ public class CryptChampion extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new CryptChampionEffect()));
// When Crypt Champion enters the battlefield, sacrifice it unless {R} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.R)), false));
this.addWatcher(new ManaSpentToCastWatcher());
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.R)), false), new ManaSpentToCastWatcher());
}
public CryptChampion(final CryptChampion card) {

View file

@ -63,8 +63,7 @@ public class PatagiaViper extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PatagiaViperSnakeToken(), 2), false));
// When Patagia Viper enters the battlefield, sacrifice it unless {U} was spent to cast it.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.U)), false));
this.addWatcher(new ManaSpentToCastWatcher());
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.U)), false), new ManaSpentToCastWatcher());
}
public PatagiaViper(final PatagiaViper card) {

View file

@ -72,8 +72,7 @@ public class ReiverDemon extends CardImpl {
Ability ability = new EntersBattlefieldTriggeredAbility(
new ConditionalOneShotEffect(new DestroyAllEffect(filter), new CastFromHandCondition(),
"if you cast it from your hand, destroy all nonartifact, nonblack creatures. They can't be regenerated"));
this.addAbility(ability);
this.addWatcher(new CastFromHandWatcher());
this.addAbility(ability, new CastFromHandWatcher());
}
public ReiverDemon(final ReiverDemon card) {

View file

@ -65,8 +65,7 @@ public class NotionThief extends CardImpl {
// Flash
this.addAbility(FlashAbility.getInstance());
// If an opponent would draw a card except the first one he or she draws in each of his or her draw steps, instead that player skips that draw and you draw a card.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NotionThiefReplacementEffect()));
this.addWatcher(new CardsDrawnDuringDrawStepWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NotionThiefReplacementEffect()), new CardsDrawnDuringDrawStepWatcher());
}

View file

@ -54,7 +54,7 @@ public class RestoreThePeace extends CardImpl {
// Return each creature that dealt damage this turn to its owner's hand.
this.getSpellAbility().addEffect(new RestoreThePeaceEffect());
this.addWatcher(new SourceDidDamageWatcher());
this.getSpellAbility().addWatcher(new SourceDidDamageWatcher());
}

View file

@ -59,14 +59,12 @@ public class ScionOfVituGhazi extends CardImpl {
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.addWatcher(new CastFromHandWatcher());
// When Scion of Vitu-Ghazi enters the battlefield, if you cast it from your hand, put a 1/1 white Bird creature token with flying onto the battlefield, then populate.
Ability ability = new EntersBattlefieldTriggeredAbility(
new ConditionalOneShotEffect(new CreateTokenEffect(new BirdToken()), new CastFromHandCondition(),
"if you cast it from your hand, put a 1/1 white Bird creature token with flying onto the battlefield,"));
ability.addEffect(new PopulateEffect("then"));
this.addAbility(ability);
this.addAbility(ability, new CastFromHandWatcher());
}
public ScionOfVituGhazi (final ScionOfVituGhazi card) {

View file

@ -70,7 +70,7 @@ public class BatwingBrume extends CardImpl {
new BatwingBrumeEffect(),
new ManaWasSpentCondition(ColoredManaSymbol.B), "Each player loses 1 life for each attacking creature he or she controls if {B} was spent to cast {this}"));
this.addInfo("Info1", "<i>(Do both if {W}{B} was spent.)<i>");
this.addWatcher(new ManaSpentToCastWatcher());
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
}

View file

@ -66,7 +66,7 @@ public class CankerousThirst extends CardImpl {
"If {G} was spent to cast {this}, you may have target creature get +3/+3 until end of turn"));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.addInfo("Info1", "<i>(Do both if {B}{G} was spent.)<i>");
this.addWatcher(new ManaSpentToCastWatcher());
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
}
public CankerousThirst(final CankerousThirst card) {

View file

@ -70,8 +70,7 @@ public class DreamThief extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When Dream Thief enters the battlefield, draw a card if you've cast another blue spell this turn.
this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), new CastBlueSpellThisTurnCondition(), rule)));
this.addWatcher(new DreamThiefWatcher(this.getId()));
this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DrawCardSourceControllerEffect(1), new CastBlueSpellThisTurnCondition(), rule)), new DreamThiefWatcher(this.getId()));
}

View file

@ -79,8 +79,7 @@ public class GroundlingPouncer extends CardImpl {
Effect effect2 = new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, false, true);
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{G/U}"), condition, rule);
ability.addEffect(effect2);
this.addAbility(ability);
this.addWatcher(new ActivatedAbilityUsedThisTurnWatcher());
this.addAbility(ability, new ActivatedAbilityUsedThisTurnWatcher());
}

View file

@ -71,8 +71,7 @@ public class HotheadedGiant extends CardImpl {
// Hotheaded Giant enters the battlefield with two -1/-1 counters on it unless you've cast another red spell this turn.
Condition condition = new CastRedSpellThisTurnCondition();
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.M1M1.createInstance(2)), new InvertCondition(condition), ""), "with two -1/-1 counters on it unless you've cast another red spell this turn"));
this.addWatcher(new HotHeadedGiantWatcher(this.getId()));
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new AddCountersSourceEffect(CounterType.M1M1.createInstance(2)), new InvertCondition(condition), ""), "with two -1/-1 counters on it unless you've cast another red spell this turn"), new HotHeadedGiantWatcher(this.getId()));
}

View file

@ -73,7 +73,7 @@ public class InvertTheSkies extends CardImpl {
new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.U)),
"and creatures you control gain flying until end of turn if {U} was spent to cast it"));
this.addInfo("Info1", "<i>(Do both if {G}{U} was spent.)<i>");
this.addWatcher(new ManaSpentToCastWatcher());
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
}
public InvertTheSkies(final InvertTheSkies card) {

View file

@ -73,7 +73,7 @@ public class Moonhold extends CardImpl {
new LockedInCondition(new ManaWasSpentCondition(ColoredManaSymbol.W))));
this.getSpellAbility().addTarget(new TargetPlayer());
this.addInfo("Info1", "<i>(Do both if {R}{W} was spent.)</i>");
this.addWatcher(new ManaSpentToCastWatcher());
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
}
public Moonhold(final Moonhold card) {

View file

@ -78,7 +78,7 @@ public class SoulReap extends CardImpl {
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new SoulReapEffect(), new CastBlackSpellThisTurnCondition(), rule));
this.addWatcher(new SoulReapWatcher(this.getId()));
this.getSpellAbility().addWatcher(new SoulReapWatcher(this.getId()));
}

View file

@ -71,8 +71,7 @@ public class TalarasBattalion extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// Cast Talara's Battalion only if you've cast another green spell this turn.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new TalarasBattalionEffect()));
this.addWatcher(new TalarasBattalionWatcher(this.getId()));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new TalarasBattalionEffect()), new TalarasBattalionWatcher(this.getId()));
}

View file

@ -72,7 +72,7 @@ public class UnnervingAssault extends CardImpl {
new BoostAllEffect(1, 0, Duration.EndOfTurn, filter2, false),
new ManaWasSpentCondition(ColoredManaSymbol.R), " and creatures you control get +1/0 until end of turn if {R} was spent to cast it"));
this.addInfo("Info1", "<i>(Do both if {U}{R} was spent.)</i>");
this.addWatcher(new ManaSpentToCastWatcher());
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
}

View file

@ -62,7 +62,7 @@ public class WavesOfAggression extends CardImpl {
this.color.setWhite(true);
// Untap all creatures that attacked this turn. After this main phase, there is an additional combat phase followed by an additional main phase.
this.addWatcher(new AttackedThisTurnWatcher());
this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher());
this.getSpellAbility().addEffect(new WavesOfAggressionUntapEffect());
this.getSpellAbility().addEffect(new WavesOfAggressionAddPhasesEffect());
// Retrace

View file

@ -92,8 +92,7 @@ public class SoulfireGrandMaster extends CardImpl {
// Instant and sorcery spells you control have lifelink.
Effect effect = new GainAbilitySpellsEffect(LifelinkAbility.getInstance(), filter);
effect.setText("Instant and sorcery spells you control have lifelink");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
this.addWatcher(new SoulfireGrandMasterLeavesStackWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect), new SoulfireGrandMasterLeavesStackWatcher());
// {2}{U/R}{U/R}: The next time you cast an instant or sorcery spell from your hand this turn, put that card into your hand instead of your graveyard as it resolves.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SoulfireGrandMasterCastFromHandReplacementEffect(), new ManaCostsImpl("{2}{U/R}{U/R}")));

View file

@ -64,9 +64,7 @@ public class SylvanLibrary extends CardImpl {
this.color.setGreen(true);
// At the beginning of your draw step, you may draw two additional cards. If you do, choose two cards in your hand drawn this turn. For each of those cards, pay 4 life or put the card on top of your library.
this.addAbility(new BeginningOfDrawTriggeredAbility(new SylvanLibraryEffect(), TargetController.YOU, true));
this.addWatcher(new CardsDrawnThisTurnWatcher());
this.addAbility(new BeginningOfDrawTriggeredAbility(new SylvanLibraryEffect(), TargetController.YOU, true), new CardsDrawnThisTurnWatcher());
}

View file

@ -69,7 +69,7 @@ public class SirensCall extends CardImpl {
// At the beginning of the next end step, destroy all non-Wall creatures that player controls that didn't attack this turn. Ignore this effect for each creature the player didn't control continuously since the beginning of the turn.
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SirensCallDestroyEffect())));
this.addWatcher(new AttackedThisTurnWatcher());
this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher());
}
public SirensCall(final SirensCall card) {

View file

@ -59,8 +59,7 @@ public class PatriciansScorn extends CardImpl {
this.color.setWhite(true);
// If you've cast another white spell this turn, you may cast Patrician's Scorn without paying its mana cost.
this.addAbility(new AlternativeCostSourceAbility(new CastWhiteSpellThisTurnCondition()));
this.addWatcher(new PatriciansScornWatcher());
this.addAbility(new AlternativeCostSourceAbility(new CastWhiteSpellThisTurnCondition()), new PatriciansScornWatcher());
// Destroy all enchantments.
this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterEnchantmentPermanent()));
}

View file

@ -56,10 +56,8 @@ public class RiverOfTears extends CardImpl {
new BasicManaEffect(Mana.BlueMana),
LandfallCondition.getInstance(),
"Add {U} to your mana pool. If you played a land this turn, add {B} to your mana pool instead"),
new TapSourceCost()));
this.addWatcher(new LandfallWatcher());
new TapSourceCost()),
new LandfallWatcher());
}
public RiverOfTears(final RiverOfTears card) {

View file

@ -60,7 +60,7 @@ public class ScoutsWarning extends CardImpl {
// The next creature card you play this turn can be played as though it had flash.
this.getSpellAbility().addEffect(new ScoutsWarningAsThoughEffect());
this.addWatcher(new ScoutsWarningWatcher());
this.getSpellAbility().addWatcher(new ScoutsWarningWatcher());
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));

View file

@ -96,7 +96,7 @@ public class AureliasFury extends CardImpl {
this.getSpellAbility().addEffect(new DamageMultiEffect(xValue));
this.getSpellAbility().addEffect(new AureliasFuryEffect());
this.getSpellAbility().addTarget(new TargetCreatureOrPlayerAmount(xValue));
this.addWatcher(new AureliasFuryDamagedByWatcher());
this.getSpellAbility().addWatcher(new AureliasFuryDamagedByWatcher());
}

View file

@ -60,7 +60,7 @@ public class ExecutionersSwing extends CardImpl {
this.getSpellAbility().addEffect(new BoostTargetEffect(-5,-5, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanentThatDealtDamageThisTurn());
this.addWatcher(new SourceDidDamageWatcher());
this.getSpellAbility().addWatcher(new SourceDidDamageWatcher());
}
public ExecutionersSwing(final ExecutionersSwing card) {

View file

@ -57,8 +57,7 @@ public class IncursionSpecialist extends CardImpl {
this.toughness = new MageInt(3);
// Whenever you cast your second spell each turn, Incursion Specialist gets +2/+0 until end of turn and is unblockable this turn.
this.addAbility(new IncursionTriggeredAbility());
this.addWatcher(new IncursionWatcher());
this.addAbility(new IncursionTriggeredAbility(), new IncursionWatcher());
}
public IncursionSpecialist(final IncursionSpecialist card) {

View file

@ -61,7 +61,7 @@ public class Quicken extends CardImpl {
// The next sorcery card you cast this turn can be cast as though it had flash.
this.getSpellAbility().addEffect(new QuickenAsThoughEffect());
this.addWatcher(new QuickenWatcher());
this.getSpellAbility().addWatcher(new QuickenWatcher());
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));

View file

@ -61,8 +61,7 @@ public class TinStreetHooligan extends CardImpl {
Ability ability = new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new DestroyTargetEffect(), new ManaWasSpentCondition(ColoredManaSymbol.G),
"if {G} was spent to cast {this}, destroy target artifact"), false);
ability.addTarget(new TargetArtifactPermanent());
this.addAbility(ability);
this.addWatcher(new ManaSpentToCastWatcher());
this.addAbility(ability, new ManaSpentToCastWatcher());
}
public TinStreetHooligan(final TinStreetHooligan card) {

View file

@ -80,10 +80,7 @@ public class TinderWall extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{R}"));
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
this.addWatcher(new BlockedByWatcher());
this.addAbility(ability, new BlockedByWatcher());
}
public TinderWall(final TinderWall card) {

View file

@ -67,8 +67,7 @@ public class CivilizedScholar extends CardImpl {
// {tap}: Draw a card, then discard a card. If a creature card is discarded this way, untap Civilized Scholar, then transform it.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CivilizedScholarEffect(), new TapSourceCost()));
this.addAbility(new TransformAbility());
this.addWatcher(new HomicidalBruteWatcher());
this.addAbility(new TransformAbility(), new HomicidalBruteWatcher());
}
public CivilizedScholar(final CivilizedScholar card) {

View file

@ -61,7 +61,7 @@ public class ArrowStorm extends CardImpl {
new DamageTargetEffect(5, false),
RaidCondition.getInstance(),
"<br/><br/><i>Raid</i> - If you attacked with a creature this turn, instead {this} deals 5 damage to that creature or player and the damage can't be prevented"));
this.addWatcher(new PlayerAttackedWatcher());
this.getSpellAbility().addWatcher(new PlayerAttackedWatcher());
}
public ArrowStorm(final ArrowStorm card) {

View file

@ -60,8 +60,7 @@ public class BellowingSaddlebrute extends CardImpl {
new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(4)),
new InvertCondition(RaidCondition.getInstance()),
"<i>Raid</i> - When {this} enters the battlefield, you lose 4 life unless you attacked with a creature this turn"
));
this.addWatcher(new PlayerAttackedWatcher());
), new PlayerAttackedWatcher());
}
public BellowingSaddlebrute(final BellowingSaddlebrute card) {

View file

@ -67,8 +67,7 @@ public class BloodsoakedChampion extends CardImpl {
new ManaCostsImpl<>("{1}{B}"),
RaidCondition.getInstance(),
"<i>Raid</i> - {1}{B}: Return {this} from your graveyard to the battlefield. Activate this ability only if you attacked with a creature this turn");
this.addAbility(ability);
this.addWatcher(new PlayerAttackedWatcher());
this.addAbility(ability, new PlayerAttackedWatcher());
}
public BloodsoakedChampion(final BloodsoakedChampion card) {

View file

@ -63,7 +63,7 @@ public class HowlOfTheHorde extends CardImpl {
// <i>Raid</i> - If you attacked with a creature this turn, when you cast your next instant or sorcery spell this turn, copy that spell an additional time. You may choose new targets for the copy.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new CreateDelayedTriggeredAbilityEffect(new HowlOfTheHordeDelayedTriggeredAbility()), RaidCondition.getInstance(), "<br><br><i>Raid</i> - If you attacked with a creature this turn, when you cast your next instant or sorcery spell this turn, copy that spell an additional time. You may choose new targets for the copy."));
this.addWatcher(new PlayerAttackedWatcher());
this.getSpellAbility().addWatcher(new PlayerAttackedWatcher());
}
public HowlOfTheHorde(final HowlOfTheHorde card) {

View file

@ -60,8 +60,7 @@ public class MarduHeartPiercer extends CardImpl {
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2)), RaidCondition.getInstance(),
"<i>Raid</i> - When {this} enters the battlefield, if you attacked with a creature this turn, {this} deals 2 damage to target creature or player.", false);
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
this.addWatcher(new PlayerAttackedWatcher());
this.addAbility(ability, new PlayerAttackedWatcher());
}
public MarduHeartPiercer(final MarduHeartPiercer card) {

View file

@ -57,9 +57,8 @@ public class MarduHordechief extends CardImpl {
// <i>Raid</i> - When Mardu Hordechief enters the battlefield, if you attacked with a creature this turn, put a 1/1 white Warrior creature token onto the battlefield
this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new MarduHordechiefToken())), RaidCondition.getInstance(),
"<i>Raid</i> - When {this} enters the battlefield, if you attacked with a creature this turn, put a 1/1 white Warrior creature token onto the battlefield.", false));
this.addWatcher(new PlayerAttackedWatcher());
"<i>Raid</i> - When {this} enters the battlefield, if you attacked with a creature this turn, put a 1/1 white Warrior creature token onto the battlefield.", false),
new PlayerAttackedWatcher());
}
public MarduHordechief(final MarduHordechief card) {

View file

@ -64,8 +64,7 @@ public class MarduSkullhunter extends CardImpl {
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(1)), RaidCondition.getInstance(),
"<i>Raid</i> - When {this} enters the battlefield, if you attacked with a creature this turn, target opponent discards a card.", false);
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
this.addWatcher(new PlayerAttackedWatcher());
this.addAbility(ability, new PlayerAttackedWatcher());
}
public MarduSkullhunter(final MarduSkullhunter card) {

View file

@ -57,8 +57,8 @@ public class MarduWarshrieker extends CardImpl {
// <em>Raid</em> - When Mardu Warshrieker enters the battlefield, if you attacked with a creature this turn, add {R}{W}{B} to your mana pool.
this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new AddManaToManaPoolSourceControllerEffect(new Mana(1,0,0,1,1,0,0))), RaidCondition.getInstance(),
"<i>Raid</i> - When {this} enters the battlefield, if you attacked with a creature this turn, add {R}{W}{B} to your mana pool.", false));
this.addWatcher(new PlayerAttackedWatcher());
"<i>Raid</i> - When {this} enters the battlefield, if you attacked with a creature this turn, add {R}{W}{B} to your mana pool.", false),
new PlayerAttackedWatcher());
}
public MarduWarshrieker(final MarduWarshrieker card) {

View file

@ -69,8 +69,7 @@ public class TimelyHordemate extends CardImpl {
Ability ability = new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect()), RaidCondition.getInstance(),
"<i>Raid</i> - When {this} enters the battlefield, if you attacked with a creature this turn, return target creature card with converted mana cost 2 or less from your graveyard to the battlefield.", false);
ability.addTarget(new TargetCardInYourGraveyard(filter));
this.addAbility(ability);
this.addWatcher(new PlayerAttackedWatcher());
this.addAbility(ability, new PlayerAttackedWatcher());
}

View file

@ -71,8 +71,8 @@ public class WarNameAspirant extends CardImpl {
RaidCondition.getInstance(),
true,
"<i>Raid</i> - {this} enters the battlefield with a +1/+1 counter on it if you attacked with a creature this turn",
"{this} enters the battlefield with a +1/+1 counter"));
this.addWatcher(new PlayerAttackedWatcher());
"{this} enters the battlefield with a +1/+1 counter"),
new PlayerAttackedWatcher());
// War-Name Aspirant can't be blocked by creatures with power 1 or less.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)));

View file

@ -64,8 +64,8 @@ public class WingmateRoc extends CardImpl {
// <em>Raid</em> - When Wingmate Roc enters the battlefield, if you attacked with a creature this turn, put a 3/4 white Bird creature token with flying onto the battlefield.
this.addAbility(new ConditionalTriggeredAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WingmateRocToken())), RaidCondition.getInstance(),
"<i>Raid</i> - When {this} enters the battlefield, if you attacked with a creature this turn, put a 3/4 white Bird creature token with flying onto the battlefield.", false));
this.addWatcher(new PlayerAttackedWatcher());
"<i>Raid</i> - When {this} enters the battlefield, if you attacked with a creature this turn, put a 3/4 white Bird creature token with flying onto the battlefield.", false),
new PlayerAttackedWatcher());
// Whenever Wingmate Roc attacks, you gain 1 life for each attacking creature.
Effect effect = new GainLifeEffect(new AttackingCreatureCount());

View file

@ -60,8 +60,7 @@ public class ChainsOfMephistopheles extends CardImpl {
this.color.setBlack(true);
// If a player would draw a card except the first one he or she draws in his or her draw step each turn, that player discards a card instead. If the player discards a card this way, he or she draws a card. If the player doesn't discard a card this way, he or she puts the top card of his or her library into his or her graveyard.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ChainsOfMephistophelesReplacementEffect()));
this.addWatcher(new CardsDrawnDuringDrawStepWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ChainsOfMephistophelesReplacementEffect()), new CardsDrawnDuringDrawStepWatcher());
}
public ChainsOfMephistopheles(final ChainsOfMephistopheles card) {

View file

@ -68,8 +68,7 @@ public class Berserk extends CardImpl {
this.color.setGreen(true);
// Cast Berserk only before the combat damage step. (Zone = all because it can be at least graveyard or hand)
this.addAbility(new SimpleStaticAbility(Zone.ALL, new BerserkReplacementEffect()));
this.addWatcher(new CombatDamageStepStartedWatcher());
this.addAbility(new SimpleStaticAbility(Zone.ALL, new BerserkReplacementEffect()), new CombatDamageStepStartedWatcher());
// Target creature gains trample and gets +X/+0 until end of turn, where X is its power.
// At the beginning of the next end step, destroy that creature if it attacked this turn.
@ -81,7 +80,7 @@ public class Berserk extends CardImpl {
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new BerserkDestroyEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.addWatcher(new AttackedThisTurnWatcher());
this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher());
}

View file

@ -29,21 +29,17 @@ package mage.sets.limitedalpha;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.replacement.DealtDamageToCreatureBySourceDies;
import mage.abilities.effects.common.ruleModifying.CantRegenerateTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.common.TargetCreatureOrPlayer;
import mage.watchers.common.DamagedByWatcher;
/**
*
@ -64,6 +60,7 @@ public class Disintegrate extends CardImpl {
effect.setText("If the creature would die this turn, exile it instead");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
this.getSpellAbility().addWatcher(new DamagedByWatcher());
}
public Disintegrate(final Disintegrate card) {

View file

@ -73,8 +73,7 @@ public class SpinerockKnoll extends CardImpl {
new ColoredManaCost(ColoredManaSymbol.R),
new SpinerockKnollCondition());
ability.addCost(new TapSourceCost());
this.addAbility(ability);
this.addWatcher(new SpinerockKnollWatcher());
this.addAbility(ability, new SpinerockKnollWatcher());
}
public SpinerockKnoll(final SpinerockKnoll card) {

View file

@ -61,9 +61,7 @@ public class WindbriskHeights extends CardImpl {
Ability ability = new ActivateIfConditionActivatedAbility(
Zone.BATTLEFIELD, new HideawayPlayEffect(), new ManaCostsImpl("{W}"), WindbriskHeightsAttackersCondition.getInstance());
ability.addCost(new TapSourceCost());
this.addAbility(ability);
this.addWatcher(new PlayerAttackedWatcher());
this.addAbility(ability, new PlayerAttackedWatcher());
}

View file

@ -72,8 +72,7 @@ public class AngelicArbiter extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AngelicArbiterCantAttackTargetEffect(Duration.WhileOnBattlefield)));
// Each opponent who attacked with a creature this turn can't cast spells.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AngelicArbiterEffect2()));
this.addWatcher(new AngelicArbiterWatcher2());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AngelicArbiterEffect2()), new AngelicArbiterWatcher2());
}
public AngelicArbiter(final AngelicArbiter card) {

View file

@ -54,7 +54,7 @@ public class FaithsReward extends CardImpl {
// Return to the battlefield all permanent cards in your graveyard that were put there from the battlefield this turn.
this.getSpellAbility().addEffect(new FaithsRewardEffect());
this.addWatcher(new FaithsRewardWatcher());
this.getSpellAbility().addWatcher(new FaithsRewardWatcher());
}
public FaithsReward(final FaithsReward card) {

View file

@ -55,8 +55,7 @@ public class AngelicAccord extends CardImpl {
this.color.setWhite(true);
// At the beginning of each end step, if you gained 4 or more life this turn, put a 4/4 white Angel creature token with flying onto the battlefield.
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new AngelToken()), TargetController.ANY, new YouGainedLifeCondition(Condition.ComparisonType.GreaterThan, 3), false));
this.addWatcher(new PlayerGainedLifeWatcher());
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new AngelToken()), TargetController.ANY, new YouGainedLifeCondition(Condition.ComparisonType.GreaterThan, 3), false), new PlayerGainedLifeWatcher());
}
public AngelicAccord(final AngelicAccord card) {

View file

@ -63,7 +63,7 @@ public class GrimReturn extends CardImpl {
effect.setText("Choose target creature card in a graveyard that was put there from the battlefield this turn. Put that card onto the battlefield under your control");
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard(textFilter)));
this.addWatcher(new CardsPutIntoGraveyardWatcher());
this.getSpellAbility().addWatcher(new CardsPutIntoGraveyardWatcher());
}
public GrimReturn(final GrimReturn card) {

View file

@ -76,7 +76,7 @@ public class SavageSummoning extends CardImpl {
this.getSpellAbility().addEffect(new SavageSummoningAsThoughEffect());
this.getSpellAbility().addEffect(new SavageSummoningCantCounterEffect());
this.getSpellAbility().addEffect(new SavageSummoningEntersBattlefieldEffect());
this.addWatcher(new SavageSummoningWatcher());
this.getSpellAbility().addWatcher(new SavageSummoningWatcher());
}

View file

@ -83,8 +83,7 @@ public class TidebinderMage extends CardImpl {
ability.addEffect(new TidebinderMageEffect());
Target target = new TargetCreaturePermanent(filter);
ability.addTarget(target);
this.addAbility(ability);
this.addWatcher(new TidebinderMageWatcher());
this.addAbility(ability, new TidebinderMageWatcher());
}

View file

@ -36,6 +36,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.counters.CounterType;
import mage.watchers.common.PlayerGainedLifeWatcher;
/**
*
@ -54,7 +55,8 @@ public class VoraciousWurm extends CardImpl {
// Voracious Wurm enters the battlefield with X +1/+1 counters on it, where X is the amount of life you've gained this turn.
this.addAbility(new EntersBattlefieldAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), ControllerGotLifeCount.getInstance(this), true)));
new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), ControllerGotLifeCount.getInstance(), true)),
new PlayerGainedLifeWatcher());
}
public VoraciousWurm(final VoraciousWurm card) {

View file

@ -54,9 +54,7 @@ public class FirstResponse extends CardImpl {
this.color.setWhite(true);
// At the beginning of each upkeep, if you lost life last turn, put a 1/1 white Soldier creature token onto the battlefield.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new FirstResponseEffect(), TargetController.ANY, false));
this.addWatcher(new PlayerLostLifeWatcher());
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new FirstResponseEffect(), TargetController.ANY, false), new PlayerLostLifeWatcher());
}

Some files were not shown because too many files have changed in this diff Show more