Aftermath: now a property of SpellAbility the Game now knows to exile the card even if it got countered.

This commit is contained in:
Hanmac
2017-05-12 04:52:08 +00:00
parent 4aa9408000
commit cb2d1a8777
4 changed files with 21 additions and 9 deletions

View File

@@ -3536,15 +3536,9 @@ public class CardFactoryUtil {
// only target RightSplit of it
final SpellAbility origSA = card.getState(CardStateName.RightSplit).getFirstAbility();
origSA.setAftermath(true);
origSA.getRestrictions().setZone(ZoneType.Graveyard);
// Add the Exile Self Part
String dbStr = "DB$ ChangeZone | Origin$ Stack | Destination$ Exile";
final AbilitySub newSA = (AbilitySub) AbilityFactory.getAbility(dbStr.toString(), card);
// append to original SA
origSA.appendSubAbility(newSA);
// The Exile part is done by the System itself
} else if (keyword.startsWith("Awaken")) {
final String[] k = keyword.split(":");
final String counters = k[1];

View File

@@ -97,6 +97,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
private List<Object> triggerRemembered = Lists.newArrayList();
private boolean flashBackAbility = false;
private boolean aftermath = false;
private boolean cycling = false;
private boolean delve = false;
private boolean dash = false;
@@ -736,6 +737,20 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
return flashBackAbility;
}
/**
* @return the aftermath
*/
public boolean isAftermath() {
return aftermath;
}
/**
* @param aftermath the aftermath to set
*/
public void setAftermath(boolean aftermath) {
this.aftermath = aftermath;
}
public boolean isOutlast() {
return outlast;
}

View File

@@ -238,7 +238,7 @@ public class SpellAbilityRestriction extends SpellAbilityVariables {
}
// TODO: this is an exception for Aftermath. Needs to be somehow generalized.
if (this.getZone() != ZoneType.Graveyard && sa.getHostCard().hasKeyword("Aftermath") && sa.isRightSplit()) {
if (this.getZone() != ZoneType.Graveyard && sa.isAftermath() && sa.isRightSplit()) {
return false;
}

View File

@@ -583,6 +583,9 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
game.getAction().exile(source);
sa.setFlashBackAbility(false);
}
else if (sa.isAftermath()) {
game.getAction().exile(source);
}
else if (source.hasKeyword("Rebound")
&& !fizzle
&& source.getCastFrom() == ZoneType.Hand