Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Ensaring Bridge's static ability to apply at game layer instead o…
…f ability later
- Loading branch information
1 parent
e94b547
commit 2c9ff90
Showing
1 changed file
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
[ | ||
new MagicStatic( | ||
MagicLayer.Ability, | ||
MagicTargetFilterFactory.CREATURE | ||
) { | ||
new MagicStatic(MagicLayer.Game) { | ||
@Override | ||
public void modAbilityFlags(final MagicPermanent source, final MagicPermanent permanent, final Set<MagicAbility> flags) { | ||
permanent.addAbility(MagicAbility.CannotAttack, flags); | ||
} | ||
@Override | ||
public boolean condition(final MagicGame game, final MagicPermanent source, final MagicPermanent target) { | ||
return target.getPower() > source.getController().getHandSize(); | ||
public void modGame(final MagicPermanent source, final MagicGame game) { | ||
final MagicTargetFilter<MagicPermanent> filter = new MagicPTTargetFilter( | ||
MagicTargetFilterFactory.CREATURE, | ||
Operator.GREATER_THAN, | ||
source.getController().getHandSize() | ||
); | ||
game.filterPermanents(filter).each { | ||
it.addAbility(MagicAbility.CannotAttack); | ||
} | ||
} | ||
} | ||
] |