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,11 +144,10 @@ 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;
} }
/** /**
* <p> * <p>
* isSecondary. * isSecondary.

View File

@@ -478,12 +478,17 @@ public class GameAction {
} }
} }
// 400.7a Effects from static abilities that give a permanent spell on the stack an ability if (zoneFrom.is(ZoneType.Stack) && toBattlefield) {
// that allows it to be cast for an alternative cost continue to apply to the permanent that spell becomes. // 400.7a Effects from static abilities that give a permanent spell on the stack an ability
if (zoneFrom.is(ZoneType.Stack) && toBattlefield && c.getCastSA() != null && !c.getCastSA().isIntrinsic() && c.getCastSA().getKeyword() != null) { // that allows it to be cast for an alternative cost continue to apply to the permanent that spell becomes.
KeywordInterface ki = c.getCastSA().getKeyword(); if (c.getCastSA() != null && !c.getCastSA().isIntrinsic() && c.getCastSA().getKeyword() != null) {
ki.setHostCard(copied); KeywordInterface ki = c.getCastSA().getKeyword();
copied.addChangedCardKeywordsInternal(ImmutableList.of(ki), null, false, copied.getTimestamp(), 0, true); ki.setHostCard(copied);
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());
} }
} }
@@ -580,12 +585,10 @@ 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();
}
} }
} }

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);