* Hushwing Gryff - Fixed not correct implemented rule modifying effect.

This commit is contained in:
LevelX2 2015-05-30 15:15:45 +02:00
parent a541d24a20
commit 726fc48e49

View file

@ -36,13 +36,13 @@ import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.keyword.FlashAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.AbilityType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@ -106,13 +106,13 @@ class HushwingGryffEffect extends ContinuousRuleModifyingEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent permanent = ((EntersTheBattlefieldEvent)event).getTarget();
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
// Because replacement events have to be executed
// call replaceEvent here without calling the triggering event after
game.getContinuousEffects().replaceEvent(event, game);
Ability ability = (Ability) getValue("targetAbility");
if (ability != null && AbilityType.TRIGGERED.equals(ability.getAbilityType())) {
Permanent p = game.getPermanent(event.getTargetId());
if (p != null && p.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
return false;
}