Fix Gorex

This commit is contained in:
tool4EvEr
2023-04-06 19:08:35 +02:00
parent 331a1df66e
commit 8a280be77f
3 changed files with 18 additions and 16 deletions

View File

@@ -144,7 +144,6 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView,
public KeywordInterface getKeyword() { public KeywordInterface getKeyword() {
return this.keyword; return this.keyword;
} }
public void setKeyword(final KeywordInterface kw) { public void setKeyword(final KeywordInterface kw) {
this.keyword = kw; this.keyword = kw;
} }

View File

@@ -478,13 +478,18 @@ public class GameAction {
} }
} }
if (zoneFrom.is(ZoneType.Stack) && toBattlefield) {
// 400.7a Effects from static abilities that give a permanent spell on the stack an ability // 400.7a Effects from static abilities that give a permanent spell on the stack an ability
// that allows it to be cast for an alternative cost continue to apply to the permanent that spell becomes. // that allows it to be cast for an alternative cost continue to apply to the permanent that spell becomes.
if (zoneFrom.is(ZoneType.Stack) && toBattlefield && c.getCastSA() != null && !c.getCastSA().isIntrinsic() && c.getCastSA().getKeyword() != null) { if (c.getCastSA() != null && !c.getCastSA().isIntrinsic() && c.getCastSA().getKeyword() != null) {
KeywordInterface ki = c.getCastSA().getKeyword(); KeywordInterface ki = c.getCastSA().getKeyword();
ki.setHostCard(copied); ki.setHostCard(copied);
copied.addChangedCardKeywordsInternal(ImmutableList.of(ki), null, false, copied.getTimestamp(), 0, true); copied.addChangedCardKeywordsInternal(ImmutableList.of(ki), null, false, copied.getTimestamp(), 0, true);
} }
// 607.2q linked ability can find cards exiled as cost while it was a spell
copied.addExiledCards(c.getExiledCards());
}
} }
// if an adventureCard is put from Stack somewhere else, need to reset to Original State // if an adventureCard is put from Stack somewhere else, need to reset to Original State
@@ -580,14 +585,12 @@ public class GameAction {
// 400.7g try adding keyword back into card if it doesn't already have it // 400.7g try adding keyword back into card if it doesn't already have it
if (zoneTo.is(ZoneType.Stack) && cause != null && cause.isSpell() && !cause.isIntrinsic() && c.equals(cause.getHostCard())) { if (zoneTo.is(ZoneType.Stack) && cause != null && cause.isSpell() && !cause.isIntrinsic() && c.equals(cause.getHostCard())) {
if (cause.getKeyword() != null) { if (cause.getKeyword() != null && !copied.getKeywords().contains(cause.getKeyword())) {
if (!copied.getKeywords().contains(cause.getKeyword())) {
copied.addChangedCardKeywordsInternal(ImmutableList.of(cause.getKeyword()), null, false, game.getNextTimestamp(), 0, false); copied.addChangedCardKeywordsInternal(ImmutableList.of(cause.getKeyword()), null, false, game.getNextTimestamp(), 0, false);
// update Keyword Cache // update Keyword Cache
copied.updateKeywords(); copied.updateKeywords();
} }
} }
}
// CR 603.6b // CR 603.6b
if (toBattlefield) { if (toBattlefield) {

View File

@@ -911,8 +911,8 @@ public abstract class SpellAbilityEffect {
if (cause.isReplacementAbility() && exilingSource.isLKI()) { if (cause.isReplacementAbility() && exilingSource.isLKI()) {
exilingSource = exilingSource.getGame().getCardState(exilingSource); exilingSource = exilingSource.getGame().getCardState(exilingSource);
} }
// only want this on permanents // avoid storing this on "inactive" cards
if (exilingSource.isImmutable() || exilingSource.isInPlay()) { if (exilingSource.isImmutable() || exilingSource.isInPlay() || exilingSource.isInZone(ZoneType.Stack)) {
// make sure it gets updated // make sure it gets updated
exilingSource.removeExiledCard(movedCard); exilingSource.removeExiledCard(movedCard);
exilingSource.addExiledCard(movedCard); exilingSource.addExiledCard(movedCard);