SpellAbility: set LastStateBattlefield only into CastSA lki copy

This commit is contained in:
Hans Mackowiak
2020-12-02 16:51:04 +01:00
parent 9e53fdbad1
commit cd69b2da2a
3 changed files with 13 additions and 8 deletions

View File

@@ -533,9 +533,6 @@ public class GameAction {
} else if (zoneTo.is(ZoneType.Stack)) { } else if (zoneTo.is(ZoneType.Stack)) {
c.setCastFrom(zoneFrom.getZoneType()); c.setCastFrom(zoneFrom.getZoneType());
if (cause != null && cause.isSpell() && c.equals(cause.getHostCard()) && !c.isCopiedSpell()) { if (cause != null && cause.isSpell() && c.equals(cause.getHostCard()) && !c.isCopiedSpell()) {
cause.setLastStateBattlefield(game.getLastStateBattlefield());
cause.setLastStateGraveyard(game.getLastStateGraveyard());
c.setCastSA(cause); c.setCastSA(cause);
} else { } else {
c.setCastSA(null); c.setCastSA(null);

View File

@@ -72,11 +72,14 @@ public class CloneEffect extends SpellAbilityEffect {
// choices need to be filtered by LastState Battlefield or Graveyard // choices need to be filtered by LastState Battlefield or Graveyard
// if a Clone enters the field as other cards it could clone, // if a Clone enters the field as other cards it could clone,
// the clone should not be able to clone them // the clone should not be able to clone them
// but do that only for Replacement Effects
if (sa.getRootAbility().isReplacementAbility()) {
if (choiceZone.equals(ZoneType.Battlefield)) { if (choiceZone.equals(ZoneType.Battlefield)) {
choices.retainAll(sa.getLastStateBattlefield()); choices.retainAll(sa.getLastStateBattlefield());
} else if (choiceZone.equals(ZoneType.Graveyard)) { } else if (choiceZone.equals(ZoneType.Graveyard)) {
choices.retainAll(sa.getLastStateGraveyard()); choices.retainAll(sa.getLastStateGraveyard());
} }
}
choices = CardLists.getValidCards(choices, sa.getParam("Choices"), activator, host); choices = CardLists.getValidCards(choices, sa.getParam("Choices"), activator, host);

View File

@@ -140,7 +140,12 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
ability.setHostCard(game.getAction().moveToStack(source, ability)); ability.setHostCard(game.getAction().moveToStack(source, ability));
} }
if (ability.equals(source.getCastSA())) { if (ability.equals(source.getCastSA())) {
source.setCastSA(ability.copy(source, true)); SpellAbility cause = ability.copy(source, true);
cause.setLastStateBattlefield(game.getLastStateBattlefield());
cause.setLastStateGraveyard(game.getLastStateGraveyard());
source.setCastSA(cause);
} }
} }