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