[AVR] Second Guest + tests. Refactored filters.

This commit is contained in:
magenoxx 2012-05-24 09:01:31 +04:00
parent 3fac42fc3c
commit 32e29392d2
184 changed files with 823 additions and 562 deletions

View file

@ -92,7 +92,7 @@ class BogGnarrTriggeredAbility extends TriggeredAbilityImpl<BogGnarrTriggeredAbi
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && filter.match(spell)) {
if (spell != null && filter.match(spell, game)) {
return true;
}
}

View file

@ -27,15 +27,12 @@
*/
package mage.sets.apocalypse;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SpellCastTriggeredAbility;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.filter.FilterCard;
@ -43,6 +40,8 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.stack.Spell;
import java.util.UUID;
/**
* @author Loki
*/
@ -90,7 +89,7 @@ class GladeGnarrTriggeredAbility extends TriggeredAbilityImpl<GladeGnarrTriggere
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && filter.match(spell)) {
if (spell != null && filter.match(spell, game)) {
return true;
}
}

View file

@ -85,7 +85,7 @@ class TranquilPathEffect extends OneShotEffect<TranquilPathEffect> {
@Override
public boolean apply(Game game, Ability source) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter)) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) {
permanent.destroy(source.getId(), game, false);
}
return true;