mirror of
https://github.com/correl/mage.git
synced 2025-01-13 11:01:58 +00:00
* Some Aftermath rule text fixes.
This commit is contained in:
parent
a7f2f0bd1c
commit
1ddd063928
16 changed files with 73 additions and 158 deletions
|
@ -72,7 +72,7 @@ public class CommitMemory extends SplitCard {
|
||||||
// Memory
|
// Memory
|
||||||
// Aftermath
|
// Aftermath
|
||||||
// Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards.
|
// Each player shuffles his or her hand and graveyard into his or her library, then draws seven cards.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new MemoryEffect());
|
getRightHalfCard().getSpellAbility().addEffect(new MemoryEffect());
|
||||||
Effect effect = new DrawCardAllEffect(7);
|
Effect effect = new DrawCardAllEffect(7);
|
||||||
effect.setText(", then draws seven cards");
|
effect.setText(", then draws seven cards");
|
||||||
|
|
|
@ -23,12 +23,12 @@ public class CutRibbons extends SplitCard {
|
||||||
// Cut
|
// Cut
|
||||||
// Cut deals 4 damage to target creature.
|
// Cut deals 4 damage to target creature.
|
||||||
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
|
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
getLeftHalfCard().getSpellAbility().addEffect(new DamageTargetEffect(4));
|
getLeftHalfCard().getSpellAbility().addEffect(new DamageTargetEffect(4).setText("Cut deals 4 damage to target creature"));
|
||||||
|
|
||||||
// to
|
// to
|
||||||
// Ribbons
|
// Ribbons
|
||||||
// Each opponent loses X life.
|
// Each opponent loses X life.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new LoseLifeOpponentsEffect(new ManacostVariableValue()));
|
getRightHalfCard().getSpellAbility().addEffect(new LoseLifeOpponentsEffect(new ManacostVariableValue()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class DestinedLead extends SplitCard {
|
||||||
// to
|
// to
|
||||||
// Lead
|
// Lead
|
||||||
// All creatures able to block target creature this turn must do so.
|
// All creatures able to block target creature this turn must do so.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
|
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new MustBeBlockedByAllTargetEffect(Duration.EndOfTurn));
|
getRightHalfCard().getSpellAbility().addEffect(new MustBeBlockedByAllTargetEffect(Duration.EndOfTurn));
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class DuskDawn extends SplitCard {
|
||||||
|
|
||||||
// Dawn
|
// Dawn
|
||||||
// Return all creature cards with power less than or equal to 2 from your graveyard to your hand.
|
// Return all creature cards with power less than or equal to 2 from your graveyard to your hand.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new DawnEffect());
|
getRightHalfCard().getSpellAbility().addEffect(new DawnEffect());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class FailureComply extends SplitCard {
|
||||||
// to
|
// to
|
||||||
// Comply
|
// Comply
|
||||||
// Choose a card name. Until your next turn, your opponents can't cast spells with the chosen name
|
// Choose a card name. Until your next turn, your opponents can't cast spells with the chosen name
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
Effect effect = new NameACardEffect(NameACardEffect.TypeOfName.ALL);
|
Effect effect = new NameACardEffect(NameACardEffect.TypeOfName.ALL);
|
||||||
effect.setText("Choose a card name");
|
effect.setText("Choose a card name");
|
||||||
getRightHalfCard().getSpellAbility().addEffect(effect);
|
getRightHalfCard().getSpellAbility().addEffect(effect);
|
||||||
|
|
|
@ -1,53 +1,53 @@
|
||||||
package mage.cards.h;
|
package mage.cards.h;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||||
import mage.abilities.effects.common.DamageAllEffect;
|
import mage.abilities.effects.common.DamageAllEffect;
|
||||||
import mage.abilities.keyword.AftermathAbility;
|
import mage.abilities.keyword.AftermathAbility;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.cards.SplitCard;
|
import mage.cards.SplitCard;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SpellAbilityType;
|
import mage.constants.SpellAbilityType;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Styxo
|
* @author Styxo
|
||||||
*/
|
*/
|
||||||
public class HeavenEarth extends SplitCard {
|
public class HeavenEarth extends SplitCard {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filterFlying = new FilterCreaturePermanent("creature with flying");
|
private static final FilterCreaturePermanent filterFlying = new FilterCreaturePermanent("creature with flying");
|
||||||
private static final FilterCreaturePermanent filterWithouFlying = new FilterCreaturePermanent("creature without flying");
|
private static final FilterCreaturePermanent filterWithouFlying = new FilterCreaturePermanent("creature without flying");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filterFlying.add(new AbilityPredicate(FlyingAbility.class));
|
filterFlying.add(new AbilityPredicate(FlyingAbility.class));
|
||||||
filterWithouFlying.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
|
filterWithouFlying.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public HeavenEarth(UUID ownerId, CardSetInfo setInfo) {
|
public HeavenEarth(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{X}{G}", "{X}{R}{R}", SpellAbilityType.SPLIT_AFTERMATH);
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{X}{G}", "{X}{R}{R}", SpellAbilityType.SPLIT_AFTERMATH);
|
||||||
|
|
||||||
// Falling
|
// Falling
|
||||||
// Falling deals X damage to each creature with flying.
|
// Falling deals X damage to each creature with flying.
|
||||||
getLeftHalfCard().getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), filterFlying));
|
getLeftHalfCard().getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), filterFlying));
|
||||||
|
|
||||||
// to
|
// to
|
||||||
// Earth
|
// Earth
|
||||||
// Earth deals X damage to each creature without flying.
|
// Earth deals X damage to each creature without flying.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), filterWithouFlying));
|
getRightHalfCard().getSpellAbility().addEffect(new DamageAllEffect(new ManacostVariableValue(), filterWithouFlying));
|
||||||
}
|
}
|
||||||
|
|
||||||
public HeavenEarth(final HeavenEarth card) {
|
public HeavenEarth(final HeavenEarth card) {
|
||||||
super(card);
|
super(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HeavenEarth copy() {
|
public HeavenEarth copy() {
|
||||||
return new HeavenEarth(this);
|
return new HeavenEarth(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class InsultInjury extends SplitCard {
|
||||||
// to
|
// to
|
||||||
// Injury
|
// Injury
|
||||||
// Injury deals 2 damage to target creature and 2 damage to target player.
|
// Injury deals 2 damage to target creature and 2 damage to target player.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
|
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer());
|
getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer());
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new InjuryEffect());
|
getRightHalfCard().getSpellAbility().addEffect(new InjuryEffect());
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class MouthFeed extends SplitCard {
|
||||||
// to
|
// to
|
||||||
// Feed
|
// Feed
|
||||||
// Draw a card for each creature you control with power 3 or greater
|
// Draw a card for each creature you control with power 3 or greater
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
Effect draw = new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(filterCreaturesYouControlPower3orGreater));
|
Effect draw = new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(filterCreaturesYouControlPower3orGreater));
|
||||||
getRightHalfCard().getSpellAbility().addEffect(draw);
|
getRightHalfCard().getSpellAbility().addEffect(draw);
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class NeverReturn extends SplitCard {
|
||||||
|
|
||||||
// Return
|
// Return
|
||||||
// Exile target card from a graveyard. Create a 2/2 black Zombie creature token.
|
// Exile target card from a graveyard. Create a 2/2 black Zombie creature token.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new ExileTargetEffect());
|
getRightHalfCard().getSpellAbility().addEffect(new ExileTargetEffect());
|
||||||
getRightHalfCard().getSpellAbility().addTarget(new TargetCardInGraveyard());
|
getRightHalfCard().getSpellAbility().addTarget(new TargetCardInGraveyard());
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken()));
|
getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken()));
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class OnwardVictory extends SplitCard {
|
||||||
// to
|
// to
|
||||||
// Victory
|
// Victory
|
||||||
// Target creature gains double strike until end of turn.
|
// Target creature gains double strike until end of turn.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
Effect effect = new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn);
|
Effect effect = new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn);
|
||||||
getRightHalfCard().getSpellAbility().addEffect(effect);
|
getRightHalfCard().getSpellAbility().addEffect(effect);
|
||||||
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
|
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class PrepareFight extends SplitCard {
|
||||||
// to
|
// to
|
||||||
// Fight
|
// Fight
|
||||||
// Target creature you control fights target creature you don't control.
|
// Target creature you control fights target creature you don't control.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new FightTargetsEffect());
|
getRightHalfCard().getSpellAbility().addEffect(new FightTargetsEffect());
|
||||||
getRightHalfCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
getRightHalfCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
||||||
Target target = new TargetCreaturePermanent(filter);
|
Target target = new TargetCreaturePermanent(filter);
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class RagsRiches extends SplitCard {
|
||||||
// to
|
// to
|
||||||
// Riches
|
// Riches
|
||||||
// Each opponent chooses a creature he or she controls. You gain control of each of those creatures.
|
// Each opponent chooses a creature he or she controls. You gain control of each of those creatures.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new RichesEffect());
|
getRightHalfCard().getSpellAbility().addEffect(new RichesEffect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class ReduceRubble extends SplitCard {
|
||||||
|
|
||||||
// Rubble
|
// Rubble
|
||||||
// Up to three target lands don't untap during their controller's next untap step.
|
// Up to three target lands don't untap during their controller's next untap step.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
Effect effect = new DontUntapInControllersNextUntapStepTargetEffect();
|
Effect effect = new DontUntapInControllersNextUntapStepTargetEffect();
|
||||||
effect.setText("Up to three target lands don't untap during their controller's next untap step");
|
effect.setText("Up to three target lands don't untap during their controller's next untap step");
|
||||||
getRightHalfCard().getSpellAbility().addEffect(effect);
|
getRightHalfCard().getSpellAbility().addEffect(effect);
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||||
import mage.abilities.keyword.AftermathAbility;
|
import mage.abilities.keyword.AftermathAbility;
|
||||||
|
@ -38,8 +39,6 @@ import mage.constants.SpellAbilityType;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.target.common.TargetCardInLibrary;
|
import mage.target.common.TargetCardInLibrary;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
|
@ -56,7 +55,7 @@ public class SpringMind extends SplitCard {
|
||||||
// Mind
|
// Mind
|
||||||
// Aftermath
|
// Aftermath
|
||||||
// Draw two cards.
|
// Draw two cards.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));
|
getRightHalfCard().getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class StartFinish extends SplitCard {
|
||||||
// Finish
|
// Finish
|
||||||
// Aftermath
|
// Aftermath
|
||||||
// As an additional cost to cast Finish, sacrifice a creature. Destroy target creature.
|
// As an additional cost to cast Finish, sacrifice a creature. Destroy target creature.
|
||||||
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility());
|
((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true));
|
||||||
getRightHalfCard().getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))));
|
getRightHalfCard().getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))));
|
||||||
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (to destoy)")));
|
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (to destoy)")));
|
||||||
getRightHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target creature"));
|
getRightHalfCard().getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target creature"));
|
||||||
|
|
|
@ -31,14 +31,11 @@ import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.*;
|
import mage.abilities.effects.*;
|
||||||
|
import mage.abilities.effects.common.ExileSpellEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.SplitCardHalf;
|
|
||||||
import mage.constants.*;
|
import mage.constants.*;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
|
||||||
import mage.game.stack.Spell;
|
|
||||||
import mage.players.Player;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Aftermath
|
* Aftermath
|
||||||
|
@ -55,7 +52,7 @@ public class AftermathAbility extends SimpleStaticAbility {
|
||||||
public AftermathAbility() {
|
public AftermathAbility() {
|
||||||
super(Zone.ALL, new AftermathCastFromGraveyard());
|
super(Zone.ALL, new AftermathCastFromGraveyard());
|
||||||
addEffect(new AftermathCantCastFromHand());
|
addEffect(new AftermathCantCastFromHand());
|
||||||
addEffect(new AftermathExileAsResolvesFromGraveyard());
|
addEffect(ExileSpellEffect.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
public AftermathAbility(final AftermathAbility ability) {
|
public AftermathAbility(final AftermathAbility ability) {
|
||||||
|
@ -68,12 +65,8 @@ public class AftermathAbility extends SimpleStaticAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule(boolean all) {
|
public String getRule() {
|
||||||
if (all) {
|
return "Aftermath <i>(Cast this spell only from your graveyard. Then exile it.)</i>";
|
||||||
return "Aftermath <i>(Cast this card only from your graveyard. Exile it afterwards.)</i>";
|
|
||||||
} else {
|
|
||||||
return "Aftermath";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +74,6 @@ class AftermathCastFromGraveyard extends AsThoughEffectImpl {
|
||||||
|
|
||||||
public AftermathCastFromGraveyard() {
|
public AftermathCastFromGraveyard() {
|
||||||
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit);
|
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit);
|
||||||
staticText = "Cast {this} from your graveyard";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AftermathCastFromGraveyard(final AftermathCastFromGraveyard effect) {
|
public AftermathCastFromGraveyard(final AftermathCastFromGraveyard effect) {
|
||||||
|
@ -98,10 +90,6 @@ class AftermathCastFromGraveyard extends AsThoughEffectImpl {
|
||||||
return new AftermathCastFromGraveyard(this);
|
return new AftermathCastFromGraveyard(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String msb(UUID id) {
|
|
||||||
return Integer.toUnsignedString((int) id.getMostSignificantBits(), 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
if (objectId.equals(source.getSourceId())
|
if (objectId.equals(source.getSourceId())
|
||||||
|
@ -153,75 +141,3 @@ class AftermathCantCastFromHand extends ContinuousRuleModifyingEffectImpl {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AftermathExileAsResolvesFromGraveyard extends ReplacementEffectImpl {
|
|
||||||
|
|
||||||
AftermathExileAsResolvesFromGraveyard() {
|
|
||||||
super(Duration.WhileOnStack, Outcome.Detriment);
|
|
||||||
this.staticText = "Exile it afterwards.";
|
|
||||||
}
|
|
||||||
|
|
||||||
AftermathExileAsResolvesFromGraveyard(AftermathExileAsResolvesFromGraveyard effect) {
|
|
||||||
super(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
|
||||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean applies(GameEvent evt, Ability source, Game game) {
|
|
||||||
ZoneChangeEvent event = (ZoneChangeEvent) evt;
|
|
||||||
if (event.getFromZone() == Zone.STACK && event.getToZone() != Zone.EXILED) {
|
|
||||||
// Moving something from stack to somewhere else
|
|
||||||
|
|
||||||
// Get the source id, getting the whole split card's ID, because
|
|
||||||
// that's the card that is changing zones in the event, but
|
|
||||||
// source.getSourceId is only the split card half.
|
|
||||||
// If branch so that we also support putting Aftermath on
|
|
||||||
// non-split cards for... whatever reason, in case somebody
|
|
||||||
// wants to do that in the future.
|
|
||||||
UUID sourceId = source.getSourceId();
|
|
||||||
Card sourceCard = game.getCard(source.getSourceId());
|
|
||||||
if (sourceCard != null && sourceCard instanceof SplitCardHalf) {
|
|
||||||
sourceCard = ((SplitCardHalf) sourceCard).getParentCard();
|
|
||||||
sourceId = sourceCard.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.getTargetId() == sourceId) {
|
|
||||||
// Moving this spell from stack to yard
|
|
||||||
Spell spell = game.getStack().getSpell(source.getSourceId());
|
|
||||||
if (spell != null && spell.getFromZone() == Zone.GRAVEYARD) {
|
|
||||||
// And this spell was cast from the graveyard, so we need to exile it
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
|
||||||
UUID sourceId = source.getSourceId();
|
|
||||||
Card sourceCard = game.getCard(source.getSourceId());
|
|
||||||
if (sourceCard != null && sourceCard instanceof SplitCardHalf) {
|
|
||||||
sourceCard = ((SplitCardHalf) sourceCard).getParentCard();
|
|
||||||
sourceId = sourceCard.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sourceCard != null) {
|
|
||||||
Player player = game.getPlayer(sourceCard.getOwnerId());
|
|
||||||
if (player != null) {
|
|
||||||
return player.moveCardToExileWithInfo(sourceCard, null, "", sourceId, game, ((ZoneChangeEvent) event).getFromZone(), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AftermathExileAsResolvesFromGraveyard copy() {
|
|
||||||
return new AftermathExileAsResolvesFromGraveyard(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue