mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Hushwing Gryff - Fixed not correct implemented rule modifying effect.
This commit is contained in:
parent
a541d24a20
commit
726fc48e49
1 changed files with 10 additions and 10 deletions
|
@ -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;
|
||||||
|
|
||||||
|
@ -104,18 +104,18 @@ class HushwingGryffEffect extends ContinuousRuleModifyingEffectImpl {
|
||||||
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
|
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -126,4 +126,4 @@ class HushwingGryffEffect extends ContinuousRuleModifyingEffectImpl {
|
||||||
return new HushwingGryffEffect(this);
|
return new HushwingGryffEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue