mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 01:38:13 +00:00
Fix effects on phased out cards
This commit is contained in:
@@ -502,7 +502,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
// gameCard is LKI in that case, the card is not in game anymore
|
||||
// or the timestamp did change
|
||||
// this should check Self too
|
||||
if (gameCard == null || !tgtC.equalsWithTimestamp(gameCard)) {
|
||||
if (gameCard == null || !tgtC.equalsWithTimestamp(gameCard) || gameCard.isPhasedOut()) {
|
||||
continue;
|
||||
}
|
||||
if (sa.usesTargeting() && !gameCard.canBeTargetedBy(sa)) {
|
||||
|
||||
@@ -4645,8 +4645,9 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
// If this is currently PhasedIn, it's about to phase out.
|
||||
// Run trigger before it does because triggers don't work with phased out objects
|
||||
getGame().getTriggerHandler().runTrigger(TriggerType.PhaseOut, runParams, false);
|
||||
runLeavesPlayCommands();
|
||||
// when it doesn't exist the game will no longer see it as tapped
|
||||
runUntapCommands();
|
||||
// TODO need to run UntilHostLeavesPlay commands but only when worded "for as long as"
|
||||
}
|
||||
|
||||
setPhasedOut(!phasedOut);
|
||||
@@ -5770,11 +5771,11 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
}
|
||||
|
||||
public final boolean canBeDestroyed() {
|
||||
return isInPlay() && (!hasKeyword(Keyword.INDESTRUCTIBLE) || (isCreature() && getNetToughness() <= 0));
|
||||
return isInPlay() && !isPhasedOut() && (!hasKeyword(Keyword.INDESTRUCTIBLE) || (isCreature() && getNetToughness() <= 0));
|
||||
}
|
||||
|
||||
public final boolean canBeSacrificed() {
|
||||
return isInPlay() && !this.isPhasedOut() && !hasKeyword("CARDNAME can't be sacrificed.");
|
||||
return isInPlay() && !isPhasedOut() && !hasKeyword("CARDNAME can't be sacrificed.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user