mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
fix inverted filter check in BlocksCreatureTriggeredAbility
This commit is contained in:
parent
53e5e2cd74
commit
212bb075ee
1 changed files with 5 additions and 8 deletions
|
|
@ -2,12 +2,12 @@ package mage.abilities.common;
|
|||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
* @author Hiddevb
|
||||
|
|
@ -17,8 +17,7 @@ public class BlocksCreatureTriggeredAbility extends TriggeredAbilityImpl {
|
|||
private final FilterCreaturePermanent filter;
|
||||
|
||||
public BlocksCreatureTriggeredAbility(Effect effect, boolean optional) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.filter = StaticFilters.FILTER_PERMANENT_CREATURE;
|
||||
this(effect, StaticFilters.FILTER_PERMANENT_CREATURE, optional);
|
||||
}
|
||||
|
||||
public BlocksCreatureTriggeredAbility(Effect effect, FilterCreaturePermanent filter, boolean optional) {
|
||||
|
|
@ -39,18 +38,16 @@ public class BlocksCreatureTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return event.getSourceId().equals(this.getSourceId())
|
||||
&& !filter.match(game.getPermanent(event.getSourceId()), game);
|
||||
&& filter.match(game.getPermanent(event.getTargetId()), getControllerId(), this, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "Whenever {this} blocks "
|
||||
+ (filter.getMessage().startsWith("an ") ? "" : "a ")
|
||||
+ filter.getMessage() + ", " ;
|
||||
return "Whenever {this} blocks " + CardUtil.addArticle(filter.getMessage()) + ", ";
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlocksCreatureTriggeredAbility copy() {
|
||||
return new BlocksCreatureTriggeredAbility(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue