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() {
return this.keyword;
}
public void setKeyword(final KeywordInterface kw) {
this.keyword = kw;
}
/**
* <p>
* 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
// 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) {
KeywordInterface ki = c.getCastSA().getKeyword();
ki.setHostCard(copied);
copied.addChangedCardKeywordsInternal(ImmutableList.of(ki), null, false, copied.getTimestamp(), 0, true);
if (zoneFrom.is(ZoneType.Stack) && toBattlefield) {
// 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.
if (c.getCastSA() != null && !c.getCastSA().isIntrinsic() && c.getCastSA().getKeyword() != null) {
KeywordInterface ki = c.getCastSA().getKeyword();
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
if (zoneTo.is(ZoneType.Stack) && cause != null && cause.isSpell() && !cause.isIntrinsic() && c.equals(cause.getHostCard())) {
if (cause.getKeyword() != null) {
if (!copied.getKeywords().contains(cause.getKeyword())) {
copied.addChangedCardKeywordsInternal(ImmutableList.of(cause.getKeyword()), null, false, game.getNextTimestamp(), 0, false);
// update Keyword Cache
copied.updateKeywords();
}
if (cause.getKeyword() != null && !copied.getKeywords().contains(cause.getKeyword())) {
copied.addChangedCardKeywordsInternal(ImmutableList.of(cause.getKeyword()), null, false, game.getNextTimestamp(), 0, false);
// update Keyword Cache
copied.updateKeywords();
}
}

View File

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