fixed The Tabernacle at Pendrell Vale forcing sacrifice of creatures which have left and re-entered the battlefield (fixes
@@ -39,7 +39,7 @@ import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
-import mage.filter.StaticFilters;
+import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -56,7 +56,13 @@ public class TheTabernacleAtPendrellVale extends CardImpl {
// All creatures have "At the beginning of your upkeep, destroy this creature unless you pay {1}."
Ability ability = new BeginningOfUpkeepTriggeredAbility(new DestroySourceUnlessPaysEffect(new ManaCostsImpl("{1}")), TargetController.YOU, false);
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES)));
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
+ new GainAbilityAllEffect(
+ ability,
+ Duration.WhileOnBattlefield,
+ new FilterCreaturePermanent("All creatures")
+ )
+ ));
}
public TheTabernacleAtPendrellVale(final TheTabernacleAtPendrellVale card) {
@@ -69,8 +75,8 @@ public class TheTabernacleAtPendrellVale extends CardImpl {
}
}
-
class DestroySourceUnlessPaysEffect extends OneShotEffect {
+
protected Cost cost;
public DestroySourceUnlessPaysEffect(Cost cost) {
@@ -87,7 +93,7 @@ class DestroySourceUnlessPaysEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
- if (player != null && permanent != null) {
+ if (player != null && permanent != null && source.getSourceObjectZoneChangeCounter() == permanent.getZoneChangeCounter(game)) {
if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + '?', source, game)) {
cost.clearPaid();
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
