mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Merge pull request #11178 from ssk97/MorphRework_v2
Morph rework and check spell characteristics
This commit is contained in:
commit
9456650693
283 changed files with 905 additions and 649 deletions
|
|
@ -35,7 +35,7 @@ public final class AbominationOfGudul extends CardImpl {
|
|||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(effect, true));
|
||||
|
||||
// Morph 2BGU
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{B}{G}{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{B}{G}{U}")));
|
||||
}
|
||||
|
||||
private AbominationOfGudul(final AbominationOfGudul card) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class AbzanGuide extends CardImpl {
|
|||
// Lifelink
|
||||
this.addAbility(LifelinkAbility.getInstance());
|
||||
// Morph {2}{W}{B}{G}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{W}{B}{G}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{W}{B}{G}")));
|
||||
}
|
||||
|
||||
private AbzanGuide(final AbzanGuide card) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public final class AcidSpewerDragon extends CardImpl {
|
|||
this.addAbility(DeathtouchAbility.getInstance());
|
||||
|
||||
// Megamorph {5}{B}{B}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{5}{B}{B}"), true));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{5}{B}{B}"), true));
|
||||
|
||||
// When Acid-Spewer Dragon is turned face up, put a +1/+1 counter on each other Dragon creature you control.
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), false, false));
|
||||
|
|
|
|||
|
|
@ -66,10 +66,14 @@ class ActOfAuthorityEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (targetPermanent == null) { return false; }
|
||||
if (targetPermanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ExileTargetEffect exileTargetEffect = new ExileTargetEffect();
|
||||
if (!exileTargetEffect.apply(game, source)) { return false; }
|
||||
if (!exileTargetEffect.apply(game, source)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (sourcePermanent == null) { return true; }
|
||||
|
|
@ -111,7 +115,9 @@ class ActOfAuthorityGainControlEffect extends ContinuousEffectImpl {
|
|||
permanent = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
}
|
||||
|
||||
if (permanent == null) { return false; }
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return permanent.changeControllerId(controller, game, source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class AerieBowmasters extends CardImpl {
|
|||
this.addAbility(ReachAbility.getInstance());
|
||||
|
||||
// Megamorph {5}{G} <i>(You may cast this card face down as a 2/2 creature for {3}. Turn it face up at any time for its megamorph cost and put a +1/+1 counter on it.)</i>)
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{5}{G}"), true));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{5}{G}"), true));
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,9 @@ class AetherspoutsEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
game.getPlayerList();
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PlayerList playerList = game.getState().getPlayersInRange(controller.getId(), game);
|
||||
playerList.setCurrent(game.getActivePlayerId());
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public final class AinokSurvivalist extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Megamorph {1}{G}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{1}{G}"), true));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{1}{G}"), true));
|
||||
|
||||
// When Ainok Survivalist is turned face up, destroy target artifact or enchantment an opponent controls.
|
||||
Effect effect = new DestroyTargetEffect();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class AinokTracker extends CardImpl {
|
|||
// First Strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
// Morph 4R
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{4}{R}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{R}")));
|
||||
}
|
||||
|
||||
private AinokTracker(final AinokTracker card) {
|
||||
|
|
|
|||
|
|
@ -75,12 +75,18 @@ class AkoumHellkiteTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent == null) { return false; }
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!permanent.isLand(game) || !permanent.isControlledBy(getControllerId())) { return false; }
|
||||
if (!permanent.isLand(game) || !permanent.isControlledBy(getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent sourcePermanent = game.getPermanent(getSourceId());
|
||||
if (sourcePermanent == null) { return false; }
|
||||
if (sourcePermanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Effect effect : getEffects()) {
|
||||
if (effect instanceof AkoumHellkiteDamageEffect) {
|
||||
|
|
@ -118,14 +124,18 @@ class AkoumHellkiteDamageEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent land = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
|
||||
if (land == null) { return false; }
|
||||
if (land == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int damage = land.hasSubtype(SubType.MOUNTAIN, game) ? 2 : 1;
|
||||
|
||||
// Get target for damange
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (player == null && permanent == null) { return false; }
|
||||
if (player == null && permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
// Target is a player
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public final class AkromaAngelOfFury extends CardImpl {
|
|||
// {R}: Akroma, Angel of Fury gets +1/+0 until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl<>("{R}")));
|
||||
// Morph {3}{R}{R}{R}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{3}{R}{R}{R}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{3}{R}{R}{R}")));
|
||||
}
|
||||
|
||||
private AkromaAngelOfFury(final AkromaAngelOfFury card) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
|
|
@ -15,13 +15,14 @@ import mage.constants.*;
|
|||
import mage.filter.common.FilterNonlandCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.util.CardUtil;
|
||||
import mage.util.GameLog;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -153,10 +154,15 @@ class AlhammarretHighArbiterCantCastEffect extends ContinuousRuleModifyingEffect
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (object != null && object.getName().equals(cardName)) {
|
||||
return true;
|
||||
SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game);
|
||||
if (spellAbility == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = spellAbility.getCharacteristics(game);
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
return CardUtil.haveSameNames(card, cardName, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,10 +65,14 @@ class AliFromCairoReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent == null) { return false; }
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (controller.getLife() > 0) && (controller.getLife() - event.getAmount()) < 1
|
||||
&& event.getPlayerId().equals(controller.getId());
|
||||
|
|
@ -77,7 +81,9 @@ class AliFromCairoReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 10/1/2008: The ability doesn't change how much damage is dealt;
|
||||
// it just changes how much life that damage makes you lose.
|
||||
|
|
|
|||
|
|
@ -69,13 +69,19 @@ class AlignedHedronNetworkExileEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false;}
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (permanent == null) { return false; }
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Set<Card> toExile = new LinkedHashSet<>(game.getBattlefield().getActivePermanents(filter, controller.getId(), source, game));
|
||||
if (toExile.isEmpty()) { return false; }
|
||||
if (toExile.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
controller.moveCardsToExile(toExile, source, game, true, CardUtil.getCardExileZoneId(game, source), permanent.getIdName());
|
||||
game.addDelayedTriggeredAbility(new OnLeaveReturnExiledAbility(), source);
|
||||
|
|
|
|||
|
|
@ -79,11 +79,17 @@ class AllHallowsEveEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card allHallowsEveCard = (Card) source.getSourceObject(game);
|
||||
if (allHallowsEveCard == null) { return false; }
|
||||
if (allHallowsEveCard == null) {
|
||||
return false;
|
||||
}
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (allHallowsEveCard.getCounters(game).getCount(CounterType.SCREAM) > 0) { return false; }
|
||||
if (allHallowsEveCard.getCounters(game).getCount(CounterType.SCREAM) > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
controller.moveCards(allHallowsEveCard, Zone.GRAVEYARD, source, game);
|
||||
Cards allCreatureCardsInGraveyards = new CardsImpl();
|
||||
|
|
|
|||
|
|
@ -61,10 +61,14 @@ class AnHavvaConstableEffect extends ContinuousEffectImpl {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject == null) { return false; }
|
||||
if (mageObject == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("green creatures");
|
||||
filter.add(new ColorPredicate(ObjectColor.GREEN));
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public final class AphettoAlchemist extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Morph {U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{U}")));
|
||||
}
|
||||
|
||||
private AphettoAlchemist(final AphettoAlchemist card) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public final class AphettoExterminator extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Morph {3}{B}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{3}{B}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{3}{B}")));
|
||||
|
||||
// When Aphetto Exterminator is turned face up, target creature gets -3/-3 until end of turn.
|
||||
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new BoostTargetEffect(-3,-3,Duration.EndOfTurn));
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public final class AquamorphEntity extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Morph {2}{U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{U}")));
|
||||
}
|
||||
|
||||
private AquamorphEntity(final AquamorphEntity card) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public final class AscendingAven extends CardImpl {
|
|||
// Ascending Aven can block only creatures with flying.
|
||||
this.addAbility(new CanBlockOnlyFlyingAbility());
|
||||
// Morph {2}{U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{U}")));
|
||||
}
|
||||
|
||||
private AscendingAven(final AscendingAven card) {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public final class AshcloudPhoenix extends CardImpl {
|
|||
this.addAbility(new DiesSourceTriggeredAbility(new AshcloudPhoenixEffect()));
|
||||
|
||||
// Morph {4}{R}{R}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{4}{R}{R}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{R}{R}")));
|
||||
|
||||
// When Ashcloud Phoenix is turned face up, it deals 2 damage to each player.
|
||||
Effect effect = new DamagePlayersEffect(2, TargetController.ANY);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package mage.cards.a;
|
|||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
|
@ -116,7 +117,11 @@ class AshioksErasureReplacementEffect extends ContinuousRuleModifyingEffectImpl
|
|||
if (event.getPlayerId().equals(source.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game);
|
||||
if (spellAbility == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = spellAbility.getCharacteristics(game);
|
||||
if (sourcePermanent == null
|
||||
|| card == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public final class AtarkaEfreet extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Megamorph {2}{R}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{R}"), true));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{R}"), true));
|
||||
|
||||
// When Atarka Efreet is turned face up, it deals 1 damage to any target.
|
||||
Effect effect = new DamageTargetEffect(1, "it");
|
||||
|
|
|
|||
|
|
@ -76,7 +76,9 @@ class AuraFinesseEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent aura = game.getPermanent(source.getFirstTarget());
|
||||
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -70,7 +70,9 @@ class AutumnWillowEffect extends AsThoughEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (!affectedControllerId.equals(source.getFirstTarget())) { return false; }
|
||||
if (!affectedControllerId.equals(source.getFirstTarget())) {
|
||||
return false;
|
||||
}
|
||||
Permanent creature = game.getPermanent(sourceId);
|
||||
|
||||
return creature != null &&sourceId.equals(source.getSourceId());
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public final class AvenLiberator extends CardImpl {
|
|||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// Morph {3}{W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{3}{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{3}{W}")));
|
||||
// When Aven Liberator is turned face up, target creature you control gains protection from the color of your choice until end of turn.
|
||||
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new GainProtectionFromColorTargetEffect(Duration.EndOfTurn));
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public final class AvenSunstriker extends CardImpl {
|
|||
// Double strike
|
||||
this.addAbility(DoubleStrikeAbility.getInstance());
|
||||
// Megamorph {4}{W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{4}{W}"), true));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{W}"), true));
|
||||
}
|
||||
|
||||
private AvenSunstriker(final AvenSunstriker card) {
|
||||
|
|
|
|||
|
|
@ -78,10 +78,14 @@ class AzorsGatewayEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject == null) { return false; }
|
||||
if (sourceObject == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, source);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public final class BaneOfTheLiving extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Morph {X}{B}{B}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{X}{B}{B}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{X}{B}{B}")));
|
||||
|
||||
// When Bane of the Living is turned face up, all creatures get -X/-X until end of turn.
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostAllEffect(morphX, morphX, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_ALL_CREATURES, false, null)));
|
||||
|
|
|
|||
|
|
@ -131,10 +131,14 @@ class BanefireCantCounterEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card == null) { return false; }
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UUID spellId = card.getSpellAbility().getId();
|
||||
if (!event.getTargetId().equals(spellId)) { return false; }
|
||||
if (!event.getTargetId().equals(spellId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return condition.apply(game, source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,9 @@ class BathaHerdEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int xValue = ((BecomesMonstrousSourceTriggeredAbility) source).getMonstrosityValue();
|
||||
|
||||
|
|
|
|||
|
|
@ -70,13 +70,19 @@ class BatheInLightEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (target == null) { return false; }
|
||||
if (target == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ChoiceColor colorChoice = new ChoiceColor();
|
||||
if (!controller.choose(Outcome.Benefit, colorChoice, game)) { return false; }
|
||||
if (!controller.choose(Outcome.Benefit, colorChoice, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
game.informPlayers(target.getName() + ": " + controller.getLogName() + " has chosen " + colorChoice.getChoice());
|
||||
game.getState().setValue(target.getId() + "_color", colorChoice.getColor());
|
||||
|
|
@ -126,7 +132,9 @@ class ProtectionChosenColorTargetEffect extends ContinuousEffectImpl {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (permanent == null) { return false; }
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjectColor color = (ObjectColor) game.getState().getValue(permanent.getId() + "_color");
|
||||
if (color != null && (protectionAbility == null || !color.equals(chosenColor))) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public final class BatteringCraghorn extends CardImpl {
|
|||
// First strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
// Morph {1}{R}{R}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{1}{R}{R}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{1}{R}{R}")));
|
||||
}
|
||||
|
||||
private BatteringCraghorn(final BatteringCraghorn card) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public final class BelltollDragon extends CardImpl {
|
|||
// Hexproof
|
||||
this.addAbility(HexproofAbility.getInstance());
|
||||
// Megamorph {5}{U}{U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{5}{U}{U}"), true));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{5}{U}{U}"), true));
|
||||
|
||||
// When Belltoll Dragon is turned face up, put a +1/+1 counter on each other Dragon creature you control.
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), false, false));
|
||||
|
|
|
|||
|
|
@ -64,7 +64,9 @@ class BendOrBreakEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Map of players and their piles
|
||||
Map<UUID, List<List<Permanent>>> playerPermanents = new LinkedHashMap<>();
|
||||
|
|
|
|||
|
|
@ -63,12 +63,16 @@ class BenevolentOfferingEffect1 extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Target target = new TargetOpponent(true);
|
||||
target.choose(Outcome.Sacrifice, source.getControllerId(), source.getSourceId(), source, game);
|
||||
Player opponent = game.getPlayer(target.getFirstTarget());
|
||||
if (opponent == null) { return false; }
|
||||
if (opponent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Effect effect = new CreateTokenTargetEffect(new SpiritWhiteToken(), 3);
|
||||
effect.setTargetPointer(new FixedTarget(opponent.getId()));
|
||||
|
|
@ -97,12 +101,16 @@ class BenevolentOfferingEffect2 extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Target target = new TargetOpponent(true);
|
||||
target.choose(Outcome.Sacrifice, source.getControllerId(), source.getSourceId(), source, game);
|
||||
Player opponent = game.getPlayer(target.getFirstTarget());
|
||||
if (opponent == null) { return false; }
|
||||
if (opponent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int count = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game) * 2;
|
||||
controller.gainLife(count, game, source);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,9 @@ class BerserkDestroyEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//create delayed triggered ability
|
||||
Effect effect = new BerserkDelayedDestroyEffect();
|
||||
|
|
@ -158,13 +160,19 @@ class BerserkDelayedDestroyEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (permanent == null) { return false; }
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class);
|
||||
if (watcher == null) { return false; }
|
||||
if (watcher == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return watcher.getAttackedThisTurnCreatures().contains(new MageObjectReference(permanent, game))
|
||||
&& permanent.destroy(source, game, false);
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ class BiomanticMasteryEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (UUID playerId : getTargetPointer().getTargets(game, source)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public final class BirchloreRangers extends CardImpl {
|
|||
new TapTargetCost(new TargetControlledCreaturePermanent(2, 2, filter, false))));
|
||||
|
||||
// Morph {G}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{G}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{G}")));
|
||||
}
|
||||
|
||||
private BirchloreRangers(final BirchloreRangers card) {
|
||||
|
|
|
|||
|
|
@ -63,20 +63,30 @@ class BitterFeudEntersBattlefieldEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent permanent = game.getPermanentEntering(source.getSourceId());
|
||||
if (permanent == null) { return false; }
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TargetPlayer target = new TargetPlayer(2, 2, true);
|
||||
controller.chooseTarget(outcome, target, source, game);
|
||||
Player player1 = game.getPlayer(target.getFirstTarget());
|
||||
if (player1 == null) { return false; }
|
||||
if (player1 == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target.getTargets().size() <= 1) { return false; }
|
||||
if (target.getTargets().size() <= 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Player player2 = game.getPlayer(target.getTargets().get(1));
|
||||
if (player2 == null) { return false; }
|
||||
if (player2 == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
game.getState().setValue(source.getSourceId() + "_player1", player1);
|
||||
game.getState().setValue(source.getSourceId() + "_player2", player2);
|
||||
|
|
@ -122,10 +132,14 @@ class BitterFeudEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
player1 = (Player) game.getState().getValue(source.getSourceId() + "_player1");
|
||||
if (player1 == null) { return false; }
|
||||
if (player1 == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
player2 = (Player) game.getState().getValue(source.getSourceId() + "_player2");
|
||||
if (player2 == null) { return false; }
|
||||
if (player2 == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UUID targetPlayerId;
|
||||
switch (event.getType()) {
|
||||
|
|
@ -134,7 +148,9 @@ class BitterFeudEffect extends ReplacementEffectImpl {
|
|||
break;
|
||||
case DAMAGE_PERMANENT:
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent == null) { return false; }
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
targetPlayerId = permanent.getControllerId();
|
||||
break;
|
||||
|
|
@ -142,7 +158,9 @@ class BitterFeudEffect extends ReplacementEffectImpl {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!player1.getId().equals(targetPlayerId) && !player2.getId().equals(targetPlayerId)) { return false; }
|
||||
if (!player1.getId().equals(targetPlayerId) && !player2.getId().equals(targetPlayerId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UUID sourcePlayerId;
|
||||
MageObject damageSource = game.getObject(event.getSourceId());
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ class UntapAllArtifactsEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) { return false; }
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Permanent artifact: game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), game)) {
|
||||
artifact.untap(game);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public final class BlisteringFirecat extends CardImpl {
|
|||
// 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()));
|
||||
// Morph {R}{R}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{R}{R}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{R}{R}")));
|
||||
}
|
||||
|
||||
private BlisteringFirecat(final BlisteringFirecat card) {
|
||||
|
|
|
|||
|
|
@ -63,10 +63,14 @@ class BloodBaronOfVizkopaEffect extends ContinuousEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
if (!conditionState(source, game)) { return false; }
|
||||
if (!conditionState(source, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent creature = game.getPermanent(source.getSourceId());
|
||||
if (creature == null) { return false; }
|
||||
if (creature == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (layer) {
|
||||
case PTChangingEffects_7:
|
||||
|
|
@ -89,15 +93,23 @@ class BloodBaronOfVizkopaEffect extends ContinuousEffectImpl {
|
|||
|
||||
private boolean conditionState(Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (controller.getLife() < 30) { return false; }
|
||||
if (controller.getLife() < 30) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (UUID opponentId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
if (!controller.hasOpponent(opponentId, game)) { return false; }
|
||||
if (!controller.hasOpponent(opponentId, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent == null) { return false; }
|
||||
if (opponent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return opponent.getLife() < 11;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,13 +67,19 @@ class BloodlineShamanEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject == null) { return false; }
|
||||
if (sourceObject == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Choice typeChoice = new ChoiceCreatureType(sourceObject);
|
||||
if (!controller.choose(outcome, typeChoice, game)) { return false; }
|
||||
if (!controller.choose(outcome, typeChoice, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
game.informPlayers(sourceObject.getLogName() + " chosen type: " + typeChoice.getChoice());
|
||||
FilterCard filterSubtype = new FilterCard();
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public final class BloodstokeHowler extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Morph {6}{R}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{6}{R}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{6}{R}")));
|
||||
|
||||
// When Bloodstoke Howler is turned face up, Beast creatures you control get +3/+0 until end of turn.
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostControlledEffect(3, 0, Duration.EndOfTurn, filter)));
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public final class Boneknitter extends CardImpl {
|
|||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
// Morph {2}{B}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{B}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{B}")));
|
||||
}
|
||||
|
||||
private Boneknitter(final Boneknitter card) {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,9 @@ class DiesWhileInGraveyardTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (!zEvent.isDiesEvent()) { return false; }
|
||||
if (!zEvent.isDiesEvent()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Zone z : Zone.values()) {
|
||||
if (game.getShortLivingLKI(sourceId, z) && z != Zone.GRAVEYARD) {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,9 @@ class BoonweaverGiantEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent sourcePermanent = source.getSourcePermanentIfItStillExists(game);
|
||||
UUID sourcePermanentId = sourcePermanent == null ? null : sourcePermanent.getId();
|
||||
|
|
|
|||
|
|
@ -109,10 +109,14 @@ class BosiumStripReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Card card = (Card) game.getState().getValue("BosiumStrip");
|
||||
if (card == null) { return false; }
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
((ZoneChangeEvent) event).setToZone(Zone.EXILED);
|
||||
return true;
|
||||
|
|
@ -126,12 +130,18 @@ class BosiumStripReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getToZone() != Zone.GRAVEYARD) { return false; }
|
||||
if (zEvent.getToZone() != Zone.GRAVEYARD) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card == null) { return false; }
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY.match(card, game)) { return false; }
|
||||
if (!StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY.match(card, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
CastFromGraveyardWatcher watcher = game.getState().getWatcher(CastFromGraveyardWatcher.class);
|
||||
return watcher != null
|
||||
|
|
|
|||
|
|
@ -68,7 +68,9 @@ class BountyOfTheLuxaEffect extends OneShotEffect {
|
|||
if (bountyOfLuxa != null && bountyOfLuxa.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter()) {
|
||||
bountyOfLuxa = null;
|
||||
}
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bountyOfLuxa != null
|
||||
&& bountyOfLuxa.getCounters(game).getCount(CounterType.FLOOD) > 0) {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,9 @@ class BraceForImpactPreventDamageTargetEffect extends PreventionEffectImpl {
|
|||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
GameEvent preventEvent = new PreventDamageEvent(event.getTargetId(), source.getSourceId(), source, source.getControllerId(), event.getAmount(), ((DamageEvent) event).isCombatDamage());
|
||||
if (game.replaceEvent(preventEvent)) { return false; }
|
||||
if (game.replaceEvent(preventEvent)) {
|
||||
return false;
|
||||
}
|
||||
int prevented;
|
||||
int damage = event.getAmount();
|
||||
event.setAmount(0);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public final class BranchsnapLorian extends CardImpl {
|
|||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
// Morph {G}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{G}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{G}")));
|
||||
}
|
||||
|
||||
private BranchsnapLorian(final BranchsnapLorian card) {
|
||||
|
|
|
|||
|
|
@ -83,10 +83,14 @@ class BridgeFromBelowAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (!zEvent.isDiesEvent()) { return false; }
|
||||
if (!zEvent.isDiesEvent()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (permanent == null) { return false; }
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return filter.match(permanent, controllerId, this, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,9 @@ class BrightflameEffect extends OneShotEffect {
|
|||
int damageDealt = 0;
|
||||
|
||||
Permanent target = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (target == null) { return false; }
|
||||
if (target == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ObjectColor color = target.getColor(game);
|
||||
damageDealt += target.damage(amount.calculate(game, source, this), source.getSourceId(), source, game);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,9 @@ class BrimazKingOfOreskosEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Token token = new CatSoldierCreatureToken();
|
||||
token.putOntoBattlefield(1, game, source, source.getControllerId());
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public final class BrineElemental extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Morph {5}{U}{U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{5}{U}{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{5}{U}{U}")));
|
||||
|
||||
// When Brine Elemental is turned face up, each opponent skips their next untap step.
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BrineElementalEffect()));
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public final class BroodhatchNantuko extends CardImpl {
|
|||
new CreateTokenEffect(new InsectToken(), SavedDamageValue.MANY), true));
|
||||
|
||||
// Morph {2}{G}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{G}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{G}")));
|
||||
}
|
||||
|
||||
private BroodhatchNantuko(final BroodhatchNantuko card) {
|
||||
|
|
|
|||
|
|
@ -76,7 +76,9 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UUID bruna = source.getSourceId();
|
||||
|
||||
|
|
@ -91,7 +93,9 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect {
|
|||
filterAuraCard.add(new AuraCardCanAttachToPermanentId(bruna));
|
||||
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent == null) { return false; }
|
||||
if (sourcePermanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
List<Permanent> fromBattlefield = new ArrayList<>();
|
||||
List<Card> fromHandGraveyard = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -72,7 +72,9 @@ class BudokaGardenerEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
if (game.getBattlefield().count(filterLands, source.getControllerId(), source, game) < 10) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,9 @@ class BurnFromWithinEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) { return false; }
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int amount = source.getManaCostsToPay().getX();
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public final class CabalExecutioner extends CardImpl {
|
|||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_A_CREATURE, 1, "that player"), false, true));
|
||||
|
||||
// Morph {3}{B}{B}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{3}{B}{B}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{3}{B}{B}")));
|
||||
}
|
||||
|
||||
private CabalExecutioner(final CabalExecutioner card) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public final class CanyonLurkers extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Morph 3R
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{3}{R}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{3}{R}")));
|
||||
}
|
||||
|
||||
private CanyonLurkers(final CanyonLurkers card) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package mage.cards.c;
|
|||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||
import mage.abilities.costs.common.DiscardCardCost;
|
||||
|
|
@ -92,18 +93,21 @@ class ChainerNightmareAdeptContinuousEffect extends AsThoughEffectImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
throw new IllegalArgumentException("Wrong code usage: can't call applies method on empty affectedAbility");
|
||||
}
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game, UUID playerId) {
|
||||
ChainerNightmareAdeptWatcher watcher = game.getState().getWatcher(ChainerNightmareAdeptWatcher.class);
|
||||
if (watcher == null || !watcher.checkPermission(
|
||||
affectedControllerId, source, game
|
||||
) || game.getState().getZone(sourceId) != Zone.GRAVEYARD) {
|
||||
playerId, source, game
|
||||
) || game.getState().getZone(objectId) != Zone.GRAVEYARD) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(sourceId);
|
||||
return card != null
|
||||
&& card.getOwnerId().equals(affectedControllerId)
|
||||
&& card.isCreature(game)
|
||||
&& !card.isLand(game);
|
||||
Card card = game.getCard(objectId);
|
||||
return card != null && affectedAbility instanceof SpellAbility
|
||||
&& card.getOwnerId().equals(playerId)
|
||||
&& ((SpellAbility) affectedAbility).getCharacteristics(game).isCreature();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import mage.MageObject;
|
|||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
|
|
@ -165,10 +166,10 @@ class ChandraDressedToKillPlayEffect extends PlayFromNotOwnHandZoneTargetEffect
|
|||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game, UUID playerId) {
|
||||
if (!super.applies(objectId, affectedAbility, source, game, playerId)) {
|
||||
if (!(super.applies(objectId, affectedAbility, source, game, playerId) && affectedAbility instanceof SpellAbility)) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(objectId);
|
||||
Card card = ((SpellAbility) affectedAbility).getCharacteristics(game);
|
||||
return card != null && card.getColor(game).isRed();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public final class ChargingSlateback extends CardImpl {
|
|||
// Charging Slateback can't block.
|
||||
this.addAbility(new CantBlockAbility());
|
||||
// Morph {4}{R}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{4}{R}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{R}")));
|
||||
}
|
||||
|
||||
private ChargingSlateback(final ChargingSlateback card) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class ChromeshellCrab extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Morph {4}{U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{4}{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{U}")));
|
||||
|
||||
// When Chromeshell Crab is turned face up, you may exchange control of target creature you control and target creature an opponent controls.
|
||||
Effect effect = new ExchangeControlTargetEffect(Duration.EndOfGame, rule, false, true);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class CoralTrickster extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Morph {U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{U}")));
|
||||
// When Coral Trickster is turned face up, you may tap or untap target permanent.
|
||||
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new MayTapOrUntapTargetEffect());
|
||||
ability.addTarget(new TargetPermanent());
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -19,6 +19,8 @@ import mage.game.permanent.Permanent;
|
|||
import mage.game.stack.Spell;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
|
|
@ -70,7 +72,11 @@ class CorneredMarketReplacementEffect extends ContinuousRuleModifyingEffectImpl
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game);
|
||||
if (spellAbility == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = spellAbility.getCharacteristics(game);
|
||||
if (card != null) {
|
||||
Spell spell = game.getState().getStack().getSpell(event.getSourceId());
|
||||
// Face Down cast spell (Morph creature) has no name
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public final class CrudeRampart extends CardImpl {
|
|||
// Defender
|
||||
this.addAbility(DefenderAbility.getInstance());
|
||||
// Morph {4}{W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{4}{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{W}")));
|
||||
}
|
||||
|
||||
private CrudeRampart(final CrudeRampart card) {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,9 @@ class CryOfTheCarnariumExileEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
CardsPutIntoGraveyardWatcher watcher = game.getState().getWatcher(CardsPutIntoGraveyardWatcher.class);
|
||||
if (controller == null || watcher == null) { return false; }
|
||||
if (controller == null || watcher == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Cards cards = new CardsImpl(watcher.getCardsPutIntoGraveyardFromBattlefield(game));
|
||||
cards.removeIf(uuid -> !game.getCard(uuid).isCreature(game));
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import mage.MageIdentifier;
|
|||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
|
|
@ -82,18 +83,22 @@ class DanithaNewBenaliasLightCastFromGraveyardEffect extends AsThoughEffectImpl
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (!source.isControlledBy(affectedControllerId) || game.getState().getZone(objectId) != Zone.GRAVEYARD) {
|
||||
public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game, UUID playerId) {
|
||||
if (!source.isControlledBy(playerId) || game.getState().getZone(objectId) != Zone.GRAVEYARD || !(affectedAbility instanceof SpellAbility)) {
|
||||
return false;
|
||||
}
|
||||
Card objectCard = game.getCard(objectId);
|
||||
Card objectCard = ((SpellAbility) affectedAbility).getCharacteristics(game);
|
||||
return objectCard != null
|
||||
&& objectCard.isOwnedBy(source.getControllerId())
|
||||
&& (objectCard.hasSubtype(SubType.AURA, game) || objectCard.hasSubtype(SubType.EQUIPMENT, game))
|
||||
&& objectCard.getSpellAbility() != null
|
||||
&& objectCard.getSpellAbility().spellCanBeActivatedRegularlyNow(affectedControllerId, game)
|
||||
&& objectCard.getSpellAbility().spellCanBeActivatedRegularlyNow(playerId, game)
|
||||
&& !DanithaNewBenaliasLightWatcher.isAbilityUsed(source, game);
|
||||
}
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
throw new IllegalArgumentException("Wrong code usage: can't call applies method on empty affectedAbility");
|
||||
}
|
||||
}
|
||||
|
||||
class DanithaNewBenaliasLightWatcher extends Watcher {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public final class DaruHealer extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Morph {W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{W}")));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public final class DaruLancer extends CardImpl {
|
|||
// First strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
// Morph {2}{W}{W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{W}{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{W}{W}")));
|
||||
}
|
||||
|
||||
private DaruLancer(final DaruLancer card) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class DaruMender extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Morph {W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{W}")));
|
||||
// When Daru Mender is turned face up, regenerate target creature.
|
||||
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new RegenerateTargetEffect());
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class DaruSanctifier extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Morph {1}{W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{1}{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{1}{W}")));
|
||||
// When Daru Sanctifier is turned face up, destroy target enchantment.
|
||||
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new DestroyTargetEffect());
|
||||
ability.addTarget(new TargetEnchantmentPermanent());
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public final class DawningPurist extends CardImpl {
|
|||
this.addAbility(new DawningPuristTriggeredAbility());
|
||||
|
||||
// Morph {1}{W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{1}{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{1}{W}")));
|
||||
}
|
||||
|
||||
private DawningPurist(final DawningPurist card) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public final class DeathmistRaptor extends CardImpl {
|
|||
this.addAbility(new TurnedFaceUpAllTriggeredAbility(Zone.GRAVEYARD, new DeathmistRaptorEffect(), new FilterControlledPermanent("a permanent you control"), false, true));
|
||||
|
||||
// Megamorph {4}{G}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{4}{G}"), true));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{G}"), true));
|
||||
}
|
||||
|
||||
private DeathmistRaptor(final DeathmistRaptor card) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public final class DefenderOfTheOrder extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Morph {W}{W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{W}{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{W}{W}")));
|
||||
// When Defender of the Order is turned face up, creatures you control get +0/+2 until end of turn.
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostControlledEffect(0, 2, Duration.EndOfTurn)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class DenProtector extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByCreaturesWithLessPowerEffect()));
|
||||
|
||||
// Megamorph {1}{G}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{1}{G}"), true));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{1}{G}"), true));
|
||||
|
||||
// When Den Protector is turned face up, return target card from your graveyard to your hand.
|
||||
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect());
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public final class Dermoplasm extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Morph {2}{U}{U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{U}{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{U}{U}")));
|
||||
|
||||
// When Dermoplasm is turned face up, you may put a creature card with a morph ability from your hand onto the battlefield face up. If you do, return Dermoplasm to its owner's hand.
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new DermoplasmEffect()));
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public final class DirgurNemesis extends CardImpl {
|
|||
// Defender
|
||||
this.addAbility(DefenderAbility.getInstance());
|
||||
// Megamorph {6}{U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{6}{U}"), true));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{6}{U}"), true));
|
||||
}
|
||||
|
||||
private DirgurNemesis(final DirgurNemesis card) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public final class DisruptivePitmage extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Morph {U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{U}")));
|
||||
}
|
||||
|
||||
private DisruptivePitmage(final DisruptivePitmage card) {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public final class DragonsEyeSavants extends CardImpl {
|
|||
this.toughness = new MageInt(6);
|
||||
|
||||
// Morph - Reveal a blue card in your hand.
|
||||
this.addAbility(new MorphAbility(new RevealTargetFromHandCost(new TargetCardInHand(filter))));
|
||||
this.addAbility(new MorphAbility(this, new RevealTargetFromHandCost(new TargetCardInHand(filter))));
|
||||
|
||||
// When Dragon's Eye Savants is turned face up, look at target opponent's hand.
|
||||
Effect effect = new LookAtTargetPlayerHandEffect();
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect;
|
||||
import mage.abilities.effects.common.cost.MorphSpellsCostReductionControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.card.FaceDownCastablePredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -15,18 +13,11 @@ import java.util.UUID;
|
|||
* @author North
|
||||
*/
|
||||
public final class DreamChisel extends CardImpl {
|
||||
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("Face-down creature spells");
|
||||
|
||||
static {
|
||||
filter.add(FaceDownCastablePredicate.instance);
|
||||
}
|
||||
|
||||
public DreamChisel(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||
|
||||
// Face-down creature spells you cast cost {1} less to cast.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filter, 1)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MorphSpellsCostReductionControllerEffect(1)));
|
||||
}
|
||||
|
||||
private DreamChisel(final DreamChisel card) {
|
||||
|
|
@ -37,4 +28,4 @@ public final class DreamChisel extends CardImpl {
|
|||
public DreamChisel copy() {
|
||||
return new DreamChisel(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ public final class DulcetSirens extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Morph {U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{U}")));
|
||||
}
|
||||
|
||||
private DulcetSirens(final DulcetSirens card) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class DwarvenBlastminer extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Morph {R}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{R}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{R}")));
|
||||
}
|
||||
|
||||
private DwarvenBlastminer(final DwarvenBlastminer card) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class EbonbladeReaper extends CardImpl {
|
|||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LoseHalfLifeTargetEffect(), false, true));
|
||||
|
||||
//Morph {3}{B}{B}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{3}{B}{B}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{3}{B}{B}")));
|
||||
}
|
||||
|
||||
private EbonbladeReaper(final EbonbladeReaper card) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class EchoTracer extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Morph {2}{U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{U}")));
|
||||
// When Echo Tracer is turned face up, return target creature to its owner's hand.
|
||||
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new ReturnToHandTargetEffect());
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public final class EfreetWeaponmaster extends CardImpl {
|
|||
this.addAbility(new EfreetWeaponmasterAbility());
|
||||
|
||||
// Morph {2}{U}{R}{W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{U}{R}{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{U}{R}{W}")));
|
||||
}
|
||||
|
||||
private EfreetWeaponmaster(final EfreetWeaponmaster card) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public final class ExaltedAngel extends CardImpl {
|
|||
// Whenever Exalted Angel deals damage, you gain that much life.
|
||||
this.addAbility(new DealsDamageGainLifeSourceTriggeredAbility());
|
||||
// Morph {2}{W}{W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{2}{W}{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{W}{W}")));
|
||||
}
|
||||
|
||||
private ExaltedAngel(final ExaltedAngel card) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
|
|
@ -100,13 +101,18 @@ class ExclusionRitualReplacementEffect extends ContinuousRuleModifyingEffectImpl
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (sourcePermanent != null && card != null) {
|
||||
if (!sourcePermanent.getImprinted().isEmpty()) {
|
||||
Card imprintedCard = game.getCard(sourcePermanent.getImprinted().get(0));
|
||||
if (imprintedCard != null) {
|
||||
return CardUtil.haveSameNames(card, imprintedCard);
|
||||
}
|
||||
SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game);
|
||||
if (spellAbility == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = spellAbility.getCharacteristics(game);
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
if (sourcePermanent != null && !sourcePermanent.getImprinted().isEmpty()) {
|
||||
Card imprintedCard = game.getCard(sourcePermanent.getImprinted().get(0));
|
||||
if (imprintedCard != null) {
|
||||
return CardUtil.haveSameNames(spellAbility.getCharacteristics(game), imprintedCard);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class FallenCleric extends CardImpl {
|
|||
// Protection from Clerics
|
||||
this.addAbility(new ProtectionAbility(filter));
|
||||
// Morph {4}{B}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{4}{B}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{B}")));
|
||||
}
|
||||
|
||||
private FallenCleric(final FallenCleric card) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public final class FathomSeer extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Morph-Return two Islands you control to their owner's hand.
|
||||
this.addAbility(new MorphAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2,2, filter, true))));
|
||||
this.addAbility(new MorphAbility(this, new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2,2, filter, true))));
|
||||
// When Fathom Seer is turned face up, draw two cards.
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new DrawCardSourceControllerEffect(2)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public final class FledglingMawcor extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// Morph {U}{U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{U}{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{U}{U}")));
|
||||
}
|
||||
|
||||
private FledglingMawcor(final FledglingMawcor card) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class FoothillGuide extends CardImpl {
|
|||
// Protection from Goblins
|
||||
this.addAbility(new ProtectionAbility(filter));
|
||||
// Morph {W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{W}")));
|
||||
}
|
||||
|
||||
private FoothillGuide(final FoothillGuide card) {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public final class FortuneThief extends CardImpl {
|
|||
// Damage that would reduce your life total to less than 1 reduces it to 1 instead.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new FortuneThiefReplacementEffect()));
|
||||
// Morph {R}{R}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{R}{R}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{R}{R}")));
|
||||
}
|
||||
|
||||
private FortuneThief(final FortuneThief card) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public final class FrontlineStrategist extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Morph {W}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{W}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{W}")));
|
||||
// When Frontline Strategist is turned face up, prevent all combat damage non-Soldier creatures would deal this turn.
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new PreventAllDamageByAllPermanentsEffect(filter, Duration.EndOfTurn, true).setText("prevent all combat damage non-Soldier creatures would deal this turn")));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public final class GathanRaiders extends CardImpl {
|
|||
new BoostSourceEffect(2,2,Duration.WhileOnBattlefield), HellbentCondition.instance,
|
||||
"<i>Hellbent</i> — {this} gets +2/+2 as long as you have no cards in hand")));
|
||||
// Morph-Discard a card.
|
||||
this.addAbility(new MorphAbility(new DiscardCardCost()));
|
||||
this.addAbility(new MorphAbility(this, new DiscardCardCost()));
|
||||
}
|
||||
|
||||
private GathanRaiders(final GathanRaiders card) {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@ package mage.cards.g;
|
|||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.PreventionEffectImpl;
|
||||
import mage.abilities.effects.common.ChooseACardNameEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -90,8 +92,12 @@ class GideonsInterventionCantCastEffect extends ContinuousRuleModifyingEffectImp
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
|
||||
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
return object != null && object.getName().equals(cardName);
|
||||
SpellAbility spellAbility = SpellAbility.getSpellAbilityFromEvent(event, game);
|
||||
if (spellAbility == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = spellAbility.getCharacteristics(game);
|
||||
return card != null && CardUtil.haveSameNames(card, cardName, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ public final class GiftOfDoom extends CardImpl {
|
|||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
this.getSpellAbility().setTargetAdjuster(GiftOfDoomAdjuster.instance); // to remove the target set if Morph casting cost is paid
|
||||
Ability ability = new EnchantAbility(auraTarget);
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
@ -56,7 +55,7 @@ public final class GiftOfDoom extends CardImpl {
|
|||
this.addAbility(ability2);
|
||||
|
||||
// Morph—Sacrifice another creature.
|
||||
this.addAbility(new MorphAbility(new SacrificeTargetCost(
|
||||
this.addAbility(new MorphAbility(this, new SacrificeTargetCost(
|
||||
new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE)
|
||||
)));
|
||||
|
||||
|
|
@ -77,18 +76,6 @@ public final class GiftOfDoom extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
enum GiftOfDoomAdjuster implements TargetAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
// if the Morph casting cost is paid, clear the target of Enchant Creature
|
||||
if (game.getState().getValue("MorphAbility" + ability.getSourceId()) == "activated") {
|
||||
ability.getTargets().clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GiftOfDoomEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public final class GlacialStalker extends CardImpl {
|
|||
this.toughness = new MageInt(5);
|
||||
|
||||
// Morph {4}{U}
|
||||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{4}{U}")));
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{4}{U}")));
|
||||
}
|
||||
|
||||
private GlacialStalker(final GlacialStalker card) {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue