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